• 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
a numeric bug.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a numeric bug.


  • Subject: a numeric bug.
  • From: deivy petrescu <email@hidden>
  • Date: Wed, 14 Sep 2005 21:44:35 -0400

There is a problem with AS it is not system wide, but it also happens with Smile.

Check this script

<script>
set lista to {}
repeat with j from 0 to 23
    set end of lista to 10 ^ j mod 7
end repeat
lista

-- {1.0, 3.0, 2.0, 6.0, 4.0, 5.0, 1.0, 3.0, 2.0, 6.0, 4.0, 5.0, 1.0, 3.0, 2.0, 6.0, 4.0, 5.0, 1.0, 3.0, 2.0, 6.0, 4.0, 1.0}

Well, it looks like the last "1.0" should be a "5.0" (count by 6). And it should!
bc gets it right. So it is not a problem with the system.


Further checking indicates that every power *after* 23 gets it wrong as well. And this is not only for 7, but for all the other numbers I checked (primes only).

I don't get it. 10^23 is way below AS numeric limit (which I believe is over 10^300).
There is something very wrong with the way AS deals with numbers.



deivy _______________________________________________ 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: Helmut Fuchs <email@hidden>
  • Prev by Date: Re: "Numeric overflow"?
  • Next by Date: Re: Scripting Image Events - some kind of bug ?
  • Previous by thread: Re: don't understand how to use timeout
  • Next by thread: Re: a numeric bug.
  • Index(es):
    • Date
    • Thread