08-08-2012 02:53 PM
I have to get exact result of 1.12345678912345 * 2.12345678912345 I know sas can handle only up to 8 bytes but my data needs prescion rounding is not allowes please help me on this challenge to overcome on it
08-08-2012 05:49 PM
@pgstats: okay, now I'm VERY curious .. how can Window's calculator do something that all of the SAS-related papers regarding numeric precision say it is a hardware limitation?
08-08-2012 06:50 PM
Just like most hand calculators, I suppose. They have tiny processors without floating point number support. They do floating point operations digit by digit, just like Astounding suggested could be done by SAS. - PG
08-08-2012 04:18 PM
Thanks, PG Stats...just what we need, comic relief!
Seriously, back in my mainframe days I know that System/370 had a sixteen byte "extended" floating point data type. I don't know if it still exists, or what the precision is, but that's the only computing environment I've ever seen that has floating point of more that eight bytes [aside, of course, from Windows calculator :-( ]
08-08-2012 04:39 PM
If you had to, you could make SAS do it. But you would have to jump through many hoops. Each incoming variable would have to be stored as a set of 16 individual variables, each one digit long. Then you could multiply each digit of one times each digit of the other, save the results, and aggregate them at the end. But you couldn't store the result in a numeric variable or you would lose the precision that you require. You would have to store the result as a character string. As others have said, SAS just isn't the right tool for the job if you need that much precision.
08-08-2012 09:33 PM
SAS's native arithmetic functionality is limited to 8 bytes, but this paper describes several ways to perform arbitrary-precision arithmetic with SAS.