data _null_;
x=0.123456789d2;
y=0.123456789e2;
z=x=y;
put x= /y= /z=;
run;
x=12.3456789
y=12.3456789
z=1
I can use D or E in scientific notation in SAS, is there any difference between them?
I think the D notation comes from FORTRAN, where it is used to denote double-precision numbers (64-bit floating-point numbers, as opposed to 32 bit - like a C double vs. float). In SAS, all numbers are double-precision floats, so it does not matter here. But I would recommend using the E notation, as that is more commonly understood.
Not to SAS.
I think the D notation comes from FORTRAN, where it is used to denote double-precision numbers (64-bit floating-point numbers, as opposed to 32 bit - like a C double vs. float). In SAS, all numbers are double-precision floats, so it does not matter here. But I would recommend using the E notation, as that is more commonly understood.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.