- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I cannot make sense of this output.
c=(abs(-2.271120)*100000);
d=floor(c);
output:
c=227112
d=227111
I expected to see d=227112 why i am getting this result?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @IGD and welcome to the SAS Support Communities!
Use the ROUND function to avoid the issue
c=round(abs(-2.271120)*100000,1e-8);
and see the 2015 thread ceil function bug? for explanations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @IGD and welcome to the SAS Support Communities!
Use the ROUND function to avoid the issue
c=round(abs(-2.271120)*100000,1e-8);
and see the 2015 thread ceil function bug? for explanations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
this worked thank you very much
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I suppose it has to do with the floating points.
Try
data _null_;
format b c d best12.;
b=abs(-2.271120);
c=(abs(-2.271120)*100000);
d=floor(c);
put b= c= d= ;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
it is giving me
b=2.27112 c=227112 d=227111 so it did not work but thank you for replying