• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: a numeric bug.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >a numeric bug. (From: deivy petrescu <email@hidden>)

  • Prev by Date: How to deal with Asynchronous Finder operations
  • Next by Date: Re: FileMaker Pro 7-8: Getting Files into Containers
  • Previous by thread: a numeric bug.
  • Next by thread: Re: a numeric bug.
  • Index(es):
    • Date
    • Thread