BookmarkSubscribeRSS Feed
data_null__
Jade | Level 19

I don't have math or computer science training and I don't understand what happens at W=61.  Or do I just have it all wrong?

27         data _null_;
28            length x $64;
29            a=1;
30            do w=1 to 64;
31               x=putn(a,'binary',w);
32               put w 2. +1 x $char64.-r;
33               end;
34            run;

1                                                                1
2                                                               01
3                                                              001
4                                                             0001
5                                                            00001
6                                                           000001
7                                                          0000001
8                                                         00000001
9                                                        000000001
10                                                       0000000001
11                                                      00000000001
12                                                     000000000001
13                                                    0000000000001
14                                                   00000000000001
15                                                  000000000000001
16                                                 0000000000000001
17                                                00000000000000001
18                                               000000000000000001
19                                              0000000000000000001
20                                             00000000000000000001
21                                            000000000000000000001
22                                           0000000000000000000001
23                                          00000000000000000000001
24                                         000000000000000000000001
25                                        0000000000000000000000001
26                                       00000000000000000000000001
27                                      000000000000000000000000001
28                                     0000000000000000000000000001
29                                    00000000000000000000000000001
30                                   000000000000000000000000000001
31                                  0000000000000000000000000000001
32                                 00000000000000000000000000000001
33                                000000000000000000000000000000001
34                               0000000000000000000000000000000001
35                              00000000000000000000000000000000001
36                             000000000000000000000000000000000001
37                            0000000000000000000000000000000000001
38                           00000000000000000000000000000000000001
39                          000000000000000000000000000000000000001
40                         0000000000000000000000000000000000000001
41                        00000000000000000000000000000000000000001
42                       000000000000000000000000000000000000000001
43                      0000000000000000000000000000000000000000001
44                     00000000000000000000000000000000000000000001
45                    000000000000000000000000000000000000000000001
46                   0000000000000000000000000000000000000000000001
47                  00000000000000000000000000000000000000000000001
48                 000000000000000000000000000000000000000000000001
49                0000000000000000000000000000000000000000000000001
50               00000000000000000000000000000000000000000000000001
51              000000000000000000000000000000000000000000000000001
52             0000000000000000000000000000000000000000000000000001
53            00000000000000000000000000000000000000000000000000001
54           000000000000000000000000000000000000000000000000000001
55          0000000000000000000000000000000000000000000000000000001
56         00000000000000000000000000000000000000000000000000000001
57        000000000000000000000000000000000000000000000000000000001
58       0000000000000000000000000000000000000000000000000000000001
59      00000000000000000000000000000000000000000000000000000000001
60     000000000000000000000000000000000000000000000000000000000001
61    1111111110000000000000000000000000000000000000000000000000000
62   11111111110000000000000000000000000000000000000000000000000000
63  011111111110000000000000000000000000000000000000000000000000000
64 0011111111110000000000000000000000000000000000000000000000000000
2 REPLIES 2
Tom
Super User Tom
Super User

You start displaying the exponent in addition to the mantissa of the floating point value.

Compare the result of

PUT A HEX16. ;

With the last row of your report.

3FF0000000000000

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 860 views
  • 0 likes
  • 3 in conversation