Understanding the IEEE Standard Floating Point format ...?

Programming, for all ages and all languages.
Post Reply
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Understanding the IEEE Standard Floating Point format ...?

Post by Perica »

..
Last edited by Perica on Tue Dec 05, 2006 9:30 pm, edited 1 time in total.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Understanding the IEEE Standard Floating Point format ...

Post by Candy »

Perica wrote: - What is the point of adding a value to the exponent to get a "true exponent" that ends up being used, why not just use the original exponent that was stored? (This is just about the only part I understand about the biased exponent - it is about adding a value to the stored exponent to get a "true exponent" which is the exponent that ends up being used).
Afaik, the biased exponent is something only used with denormals, and is used to make denormals start with a 1. A denormal is a number that's too small to be noted as a normal, but is just about 0.

The biased exponent is then the real exponent, plus a possible shift for the denormal amount.
- Is the exponent that is stored in the floating point number a signed 2's complement integer?
No, the exponent is the actual exponent, plus a certain number depending on the amount of bits available. The number added should always be either half the amount, or half the amount minus one. Thought it was the first, but it could be the second.

Denormals are numbers that don't have an implicit leading 1, like all normal numbers. Since they don't need the leading one, they can use a part of the exponent to increase the range very slightly at the expense of precision.
CESS.tk

Re:Understanding the IEEE Standard Floating Point format ...

Post by CESS.tk »

Perica wrote: - What is the point of adding a value to the exponent to get a "true exponent" that ends up being used, why not just use the original exponent that was stored? (This is just about the only part I understand about the biased exponent - it is about adding a value to the stored exponent to get a "true exponent" which is the exponent that ends up being used).
The value is added so you get a positive exponent, and you wouldn't need an extra bit for the sign. It's all about using as little bits as possible and still getting as much precision/range as possible out of it.
Perica wrote: - Is the exponent that is stored in the floating point number a signed 2's complement integer?
Oh, I've already answered this one. It's an unsigned integer.
Single precision floating point exponents get 8 bits and use excess 127, double precision exponents get 11 bits and use excess 1023.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Understanding the IEEE Standard Floating Point format ...

Post by Candy »

StrangeQuark wrote:
Perica wrote: - Is the exponent that is stored in the floating point number a signed 2's complement integer?
Oh, I've already answered this one. It's an unsigned integer.
Single precision floating point exponents get 8 bits and use excess 127, double precision exponents get 11 bits and use excess 1023.
Ok, so it's the second one. PS, for long doubles it's 16383 on both 80-bits and 128-bits long doubles.
Post Reply