BookmarkSubscribeRSS Feed
ThomasH
Calcite | Level 5
Hi all,

why would this piece of code

---
data _null_;

format a b 31.15;

a = 12345678912345.123456789123456;

b = a + 1;

run;
---

result in

b = 12345678912346.100000000000000?

OS is AIX.

Thanks,
Thomas
1 REPLY 1
Doc_Duke
Rhodochrosite | Level 12
Roundoff.

SAS stores all numbers in floating point. The largest is 8 bytes. Your OS companion can tell you how big a number can be stored with what level of precision.

Doc Muhlbaier
Duke

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 897 views
  • 0 likes
  • 2 in conversation