BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
wxzhai
Obsidian | Level 7

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
FreelanceReinh
Jade | Level 19

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.

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

@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.

wxzhai
Obsidian | Level 7
thank you!
FreelanceReinh
Jade | Level 19

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.

wxzhai
Obsidian | Level 7

thank you! very clear!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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