# IEEE 754-2008 (binary 16) inaccuracy in Wikipedia?

This topic is 3195 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

To open, I'm using Wikipedia because I can't find any document online for the IEEE 754-2008 standard like a specification for OpenGL, so Wikipedia is my next best option. I'm currently implementing the binary16 portion of the standard on a simple embedded processor that only supports integer manipulation in hardware. Now I am assuming the following as fact that binary16 numbers have 3 digits of precision after the decimal point: floor(log(2^11)) = 3; a starting digit of 1 before the decimal point (1.) is assumed with the coefficient/significand representing the fractional part, when the exponent is neither 0 or 16 (biased); and the maximum exponent is 15 (biased). I arrive at the following value being the maximum that a binary16 representation can hold: 1.999 * 2^15 = 65503.232, and the binary representation of that would be: 0 11110 1111100111 (separated into S EEEEE CCCCCCCCCCC) where S = 0 (positive), E = 30 (unbiased) 15 (biased), C = 999. That translates into the following hexadecimal representation: 0x7BE7 On Wikipedia they are reporting 65504 as the maximum value. (My number, 65503.232, doesn't even round to that.) And they say the hexadecimal representation is 0x7BFF: 0 11110 1111111111. Notice that our sign and exponent are the same, the only thing they are changing is the coefficient which is equal to 1023 in base 10. This doesn't make sense to me. Maybe I am missing something, or maybe I am right. Can someone explain why they are wrong or why they are right? This is only only thing that is holding me up in my analysis.

##### Share on other sites
Because that's what makes sense. A coefficient of 1111100111 = 999 in decimal, so you get 1.999, but a coefficient of 1111111111 = 1023 which would be 1.1023? That doesn't make sense.

##### Share on other sites
If it's anything like normal 32 bit floats (which I'm sure it is), then the fraction isn't encoding a decimal (base 10) value, they're encoding the negative powers of 2.

1.1000000000 = 1.5, not 1.512 (frac = 2^-1)
1.0100000000 = 1.25, not 1.256 (frac = 2^-2)
1.1100000000 = 1.75, not 1.768 (frac = 2^-1 + 2^-2)

##### Share on other sites
Quote:
 Original post by NamethatnobodyelsetookIf it's anything like normal 32 bit floats (which I'm sure it is), then the fraction isn't encoding a decimal (base 10) value, they're encoding the negative powers of 2.1.1000000000 = 1.5, not 1.512 (frac = 2^-1)1.0100000000 = 1.25, not 1.256 (frac = 2^-2)1.1100000000 = 1.75, not 1.768 (frac = 2^-1 + 2^-2)

Exactly

##### Share on other sites
Yes, that's what I was missing Namethatnobodyelsetook, thanks.

1. 1
2. 2
3. 3
4. 4
Rutin
12
5. 5

• 12
• 16
• 10
• 14
• 10
• ### Forum Statistics

• Total Topics
632659
• Total Posts
3007692
• ### Who's Online (See full list)

There are no registered users currently online

×