-
August 18th, 2007, 04:08 PM
#1
Floating point bias question
question:
Why is bias like 127 added to floating point numbers' exponets? Why can't the e in the following quote be 2 instead of 127?
"For example, the number -6.25 in binary is -110.01, or -1 X 1.1001 x 22. This would be represented with s=l,e = 2+127= 10000001, m = [1.] 1001"
Thanks in advance.
http://yujiaoguo.blogspot.com
Last edited by ynkm169; August 18th, 2007 at 04:25 PM.
-
August 18th, 2007, 05:52 PM
#2
Re: Floating point bias question
Hello
I think I know what you are asking.
Floating point numbers are stored differently than integers.
For instance, if you are using 32 bits the first bit is the sign
2 thru 18 ( for instance cant remember the exact number )
hold the significant digits (mantissa?) and 19 thru 32 the exponent
or how far to move the implied floating point to the left or right
Regards
"trampling out the vintage"
-
August 18th, 2007, 06:28 PM
#3
Re: Floating point bias question
See also " IEEE Standard for Binary Floating-Point Arithmetic (IEEE 754)" at http://en.wikipedia.org/wiki/Ieee_floating_point
Mike
-
August 18th, 2007, 06:44 PM
#4
Re: Floating point bias question
Originally Posted by MikeAThon
This web page is really really helpful. particular this part:
[edit] Exponent biasing
The exponent is biased by 2e−1−1, see also Excess-N. Biasing is done because exponents have to be signed values in order to be able to represent both tiny and huge values, but two's complement, the usual representation for signed values, would make comparison harder. To solve this the exponent is biased before being stored, by adjusting its value to put it within an unsigned range suitable for comparison.
For example, to represent a number which has exponent of 17, exponent is 17 + 2e−1−1. Assuming e = 8, the exponent is equal to 17 + 128 − 1 = 144.
Thanks
-
August 19th, 2007, 10:38 AM
#5
Re: Floating point bias question
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|