Groovy hepcat (e-mail address removed) was jivin' on Sat, 16 Jun
2007 05:07:47 -0700 in comp.lang.c.
Re: Floating point rounding error's a cool scene! Dig it!
Is this rule of representing decimals in binary applicable only to
754?
This doesn't represent decimals. It represents values. Values are
neither decimal nor binary, but may be expressed in decimal or binary
or, indeed, any other number system, such as hexadecimal or octal. A
computer stores values expressed internally in binary, but may read in
or write out the values in decimal or other systems.
What Richard showed you is not a complete floating point
representation. It was simply a binary representation of a value. This
is refered to as "fixed point". Floating point representations have a
mantissa part and an exponent part. These parts are (typically)
expressed in binary. For example, instead of representing .75 as .11
in fixed point binary, it might be represented as (just to keep things
simple) an 8 bit binary mantissa, 00000011, and an 8 bit exponent,
11111110 (that's -2 expressed as an 8 bit binary number). This
represents 3 * 2 ** -2 (using ** for exponentiation) or 3 >> 2. Real
floating point implementations, however, use more bits for the
mantissa and exponent, often with separate sign bits.
--
Dig the even newer still, yet more improved, sig!
http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?