Showing posts with label floating-point. Show all posts
Showing posts with label floating-point. Show all posts

Friday, 11 January 2013

Floating point representation

The floating point representation of a number has two parts. The first part represents a signed, fixed point number called the mantissa. The second point designates the position of the decimal point and is called as the exponent. The fixed mantissa may be a

Monday, 26 December 2011

Floating point representation

The floating point representation of a number has two parts. The first parts represent a signed, fixed- point number called the mantissa. The second part designates the position of the decimal point and is called the exponent. The fixed-point mantissa may be a fraction or an integer. For example, the decimal number +6132.789 is represented in floating-point with a fraction and an exponent as follows:

Fraction                 Exponent


+0.6132789          +04


This representation is equivalent to the scientific notation +0.6132789*10^+4.

Floating –point is always interpreted to represent a number in the following form:

M*r ^e


Only the mantissa m and the exponent e are physically represented in

Sunday, 27 November 2011

Are there any problems with performing mathematical operations on different variable types?

C has three categories of built-in data types: pointer types, integral types, and floating-point types.

Pointer types are the most restrictive in terms of the operations that can be performed on them. They are limited to

" -  " subtraction of two pointers, valid only when both pointers point to elements in the same array. The result is the same as subtracting the integer subscripts corresponding to the two pointers.

" + " addition of a pointer and an integral type. The result is a

Wednesday, 23 November 2011

How reliable are floating-point comparisons?

Floating-point numbers are the “black art” of computer programming. One reason why this is so is that there is no optimal way to represent an arbitrary number. The Institute of Electrical and Electronic Engineers (IEEE) has developed a standard for the representation of floating-point numbers, but you cannot guarantee that every machine you use will conform to the standard.

Even if your machine does conform to the standard, there are deeper issues. It can be shown mathematically that there are an infinite number of “real” numbers between any two numbers. For the computer to distinguish between two numbers, the bits that