BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
whymath
Lapis Lazuli | Level 10
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?

1 ACCEPTED SOLUTION

Accepted Solutions
s_lassen
Meteorite | Level 14

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.

View solution in original post

2 REPLIES 2
s_lassen
Meteorite | Level 14

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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 2 replies
  • 878 views
  • 3 likes
  • 3 in conversation