## question - largest integer represented exactly

Hi, I'm not very much understanding it in Windows: if length is 3 , why the largest integer represented exactly is 8,192?

the mantissa is 12 bits ( 24 - 1 -11 = 12), so 2 ^12 = 4096. why it is 8,192?

thanks

1 ACCEPTED SOLUTION

Accepted Solutions

## Re: question - largest integer represented exactly

Hi @wxzhai,

It is the so called "implied bit" (cf. Numeric Length in SAS®: A Case Study in Decision Making) that yields another factor 2: If the eleven exponent bits stand for an order of magnitude 2¹², the twelve mantissa bits run from 000000000000,  representing 2¹²=4096, through 111111111111, representing 2¹²+(2¹²−1)=8191. That is, the first "1" in the actual (mathematical) binary representation of those numbers is omitted (because it's redundant) to save one bit. Finally, 8192 has, again, all mantissa bits zero (like 4096 or any other power of 2), but the exponent increases by 1 to represent 2¹³. The next larger integer has mantissa bits 000000000001. Due to the increased exponent, this representation means 1.000000000001 [binary!] * 2¹³ = 8194, showing that 8193 cannot be represented with a length of 3 bytes, so in this sense (of consecutive integers) 8192 is the largest.

4 REPLIES 4

## Re: question - largest integer represented exactly

@wxzhai wrote:

Hi, I'm not very much understanding it in Windows: if length is 3 , why the largest integer represented exactly is 8,192?

the mantissa is 12 bits ( 24 - 1 -11 = 12), so 2 ^12 = 4096. why it is 8,192?

thanks

The most significant bit is not stored.  It is implied.

thank you!

## Re: question - largest integer represented exactly

Hi @wxzhai,

It is the so called "implied bit" (cf. Numeric Length in SAS®: A Case Study in Decision Making) that yields another factor 2: If the eleven exponent bits stand for an order of magnitude 2¹², the twelve mantissa bits run from 000000000000,  representing 2¹²=4096, through 111111111111, representing 2¹²+(2¹²−1)=8191. That is, the first "1" in the actual (mathematical) binary representation of those numbers is omitted (because it's redundant) to save one bit. Finally, 8192 has, again, all mantissa bits zero (like 4096 or any other power of 2), but the exponent increases by 1 to represent 2¹³. The next larger integer has mantissa bits 000000000001. Due to the increased exponent, this representation means 1.000000000001 [binary!] * 2¹³ = 8194, showing that 8193 cannot be represented with a length of 3 bytes, so in this sense (of consecutive integers) 8192 is the largest.

## Re: question - largest integer represented exactly

thank you! very clear!

Discussion stats
• 4 replies
• 245 views
• 4 likes
• 3 in conversation