Re: a numeric bug.
Re: a numeric bug.
- Subject: Re: a numeric bug.
- From: Christopher Nebel <email@hidden>
- Date: Thu, 15 Sep 2005 10:38:11 -0700
On Sep 15, 2005, at 3:13 AM, Emmanuel wrote:
At 9:05 AM +0100 9/15/05, has wrote:
deivy petrescu wrote:
I don't get it. 10^23 is way below AS numeric limit (which I
believe is over 10^300).
The precision limit is much lower, however - approx. ±9e15. Beyond
that they're only approximations, and calculations involving the
least significant digits are going to have inaccuracies.
I think that Deivy's point is that when it comes to take the "mod"
a smart computer storing 1.000 as the mantissa and 24 as the
exponent of 10 should be able to give the correct result.
Sure, but that's not how the internal representation of numbers in
AppleScript works. It's using IEEE 754 double-precision numbers,
which use mantissa * 2**exponent, which is notoriously inaccurate
when representing powers of 10. (10 is an infinite repeating decimal
in base 2.) If you want arbitrary precision or strict financial
math, you're using the wrong language, and you should stop one or the
other.
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden