DATA Step, Macro, Functions and more

Calculation

Reply
Contributor
Posts: 51

Calculation

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
Trusted Advisor
Posts: 2,116

Re: Calculation

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
Ask a Question
Discussion stats
  • 1 reply
  • 108 views
  • 0 likes
  • 2 in conversation