Re: a numeric bug.
Re: a numeric bug.
- Subject: Re: a numeric bug.
- From: Helmut Fuchs <email@hidden>
- Date: Thu, 15 Sep 2005 11:14:27 +0200
No Deivy, this is not a problem with AS, this is a general problem
with floating point arithmetic. And it's not wrong, everything works
as advertised.
At 21:44 Uhr -0400 14.09.2005, deivy petrescu wrote:
10^23 is way below AS numeric limit (which I believe is over 10^300).
I don't remember the actual limitations, but there's a difference
between precision and magnitude of representable numbers.
bc gets it right. So it is not a problem with the system.
See the man page of bc:
"bc is a language that supports arbitrary precision numbers"
Arbitrary precision also means arbitrary storage size. For numerous
reasons this is not practical in everyday application of numbers,
where a fixed storage size for numbers is preferred.
So you've got to make tradeoffs. (More bad english follows ;-) )
In everday life arbitrary precision is neither manageable nor
desirable. One might say "I walked a kilometre." but not "I walked
for 1002.2394 metres." The interesting part of the number here lies
in the magnitude.
Following that rationale floating point numbers are divided into a
mantissa (the digits of the highest magnitude) and an exponent (which
defines the magnitude of the highest digit).
So, given a system with for example 4 digits of precision, all
integer numbers bigger than 9999 will not be exactly representable.
And that's what you hit on here.
HTH,
Helmut
_______________________________________________
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