Hello Infogamer,
The set of numbers that cannot be represented exactly in floating
point is is basically equivalent to the set of numbers that do not
have an exact value as a floating point fraction. Something as simple
as 0.1 CANNOT be represented exactly as a floating point number. But a
negative number like -0.5 can be represented exactly. The latter has
an exact representation because 1/2 can be represented exactly as a
binary fraction.
http://www.nuvisionmiami.com/books/asm/workbook/floating_tut.htm
is a pretty good tutorial on floating point numbers. It uses IEEE
format floating point (the most common) as the data representation.
Note that the mantissa (the binary fraction) has a limited precision.
This basically limits the number of significant digits (roughly 5 for
a single precision floating point).
Note also that the exponent (the binary exponent) has a limited range
as well. This limits how large / small the value will be.
For more good references, try a search like:
floating point binary representation
floating point binary tutorial
or similar phrases.
--Maniac |
Request for Answer Clarification by
infogamer-ga
on
22 Mar 2005 14:46 PST
Floating point representations aren't able to perfectly represent
extremely small numbers is what I understand the answer to be, such as
imaginary numbers and numbers to the left of the decimal point. Is
this correct? Thank-you so much for the link to the Floating Point
Tutorial.
|
Clarification of Answer by
maniac-ga
on
22 Mar 2005 20:21 PST
Hello Infogamer,
I do not understand what you mean by "extremely small numbers". There
are a number of small values that floating point can perfectly
represent and other values that it cannot perfectly represent.
For example:
3/1048576 (basically 3/(2^20))
is a value that can be represented exactly yet
3/1000000
cannot be represented exactly. Note the smaller value can be
represented exactly while the larger cannot. This gets back to the
statement I made previously about binary fractions.
In a similar manner, a value like
3145728 (basically 3*(2^20)
can be represented exactly but
3000000
cannot because there are not enough significant digits in the mantissa
in a single precision (32 bit) floating point value.
Imaginary numbers require a pair of values. For example, the square
root of -1 can be represented as:
0.0, 1.0
which has a real value of zero and imaginary value of one.
I suggest you work through several examples using the floating point
tutorial to more clearly understand the values that can and cannot be
represented in floating point.
--Maniac
|
Request for Answer Clarification by
infogamer-ga
on
22 Mar 2005 21:07 PST
Computers don't represent certain types of numbers, due to
floating-point representations, which may be either A.)extremely large
numbers, B.)extremely small numbers, C.)numbers with values with
repeating fractional digits or D.) negative numbers. Which of these
choices might be the answer?
|
Clarification of Answer by
maniac-ga
on
23 Mar 2005 11:25 PST
Hello Infogamer,
To summarize the classes you refer to. Do not means the floating point
value does not represent the value exactly. Do means the floating
point value can represent the value exactly. Maybe depends on the
situation as described.
A - Do not, if extremely large is greater than the range of the exponent.
B - Do not, if extremely small is less than the range of the exponent.
C - Maybe, it depends on the value. Some values can repeat in decimal
and not in binary (and vice versa).
D - Do, if the positive value would otherwise be represented exactly.
Again, I suggest you review the tutorial (and other references from
the search phrases) more carefully so you understand the concept
behind the values represented in floating point on the computer.
--Maniac
|