An Idea Exchange for SAS software and services

Comments
by Community Manager
on ‎08-04-2016 02:45 PM

Numerical precision and how numbers are stored is governed by IEEE standards, as you probably know.  I think your main complaint is the difference you see across platforms, and not necessarily the imprecision in one vs the other?

 

This program shows a little bit more about how the numbers are stored:

 

data T;
  NB1=0.5000000000000000000000000;  
  put NB1:hex16.;
  A=(0.5=NB1); put A=;
  NB2=0.500000000000000000000000;  
  put NB2:hex16.;
  B=(0.5=NB2); put B=;
run;

Output on Windows:

3FDFFFFFFFFFFFFE
A=0
3FE0000000000000
B=1

On UNIX:

3FE0000000000000
A=1
3FE0000000000000
B=1
by PROC Star
on ‎08-04-2016 05:34 PM

Thanks Chris, The information you mention is already discussed in the thread cited in my first post.

This is not a storage issue. It is a reading issue.

0.5 can be stored with full precision.

SAS under Windows (and no other platform, and WIN32 and W64 behave differently) reads some values erroneously.

by PROC Star
on ‎08-11-2016 05:35 PM

Thank you @ChrisHemedinger for bringing Mike into the discussion the the forum thread!

Idea Statuses
Top Liked Authors