• 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: 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


  • Follow-Ups:
    • Re: a numeric bug.
      • From: deivy petrescu <email@hidden>
    • Re: a numeric bug.
      • From: Doug McNutt <email@hidden>
References: 
 >Re: a numeric bug. (From: has <email@hidden>)
 >Re: a numeric bug. (From: Emmanuel <email@hidden>)

  • Prev by Date: RE: Converting Mac Roman and/or UTF 16 to UTF 8?
  • Next by Date: Re: How to deal with Asynchronous Finder operations
  • Previous by thread: Re: a numeric bug.
  • Next by thread: Re: a numeric bug.
  • Index(es):
    • Date
    • Thread