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

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 913 views
  • 0 likes
  • 2 in conversation