• 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: Strange numbers to AS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange numbers to AS


  • Subject: Re: Strange numbers to AS
  • From: Andrew Oliver <email@hidden>
  • Date: Fri, 02 May 2003 15:54:01 -0700

I'm guessing it's because 4600000000 is greater than the maximum value
supported by an integer variable.

In AppleScript, an integer has a max value of 2^32, or 4294967296. Since
4600000000 exceeds that, you overflow and get the remainder, i.e.

305032704 is 4600000000 mod (2^32)

You can get around this by using real math rather than integer math, i.e.
use 4.6E+9 instead of 4600000000, or "4600000000 as real" rather than 'as
number'

Andrew
:)

On 5/2/03 3:10 PM, "Thomas C." <email@hidden> wrote:

> Why does this returns true in the script editor ?
>
> 305032704 = ("4600000000" as number)
>
> If I just enter 4600000000 in the script editor and check syntax, it
> becames 305032704 !
> Why ?
>
> Thanks Thomas
> _______________________________________________
> applescript-users mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/applescript-users
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Strange numbers to AS (From: "Thomas C." <email@hidden>)

  • Prev by Date: Re: Unicode/UTF confusion
  • Next by Date: Re: open for access question
  • Previous by thread: Strange numbers to AS
  • Next by thread: Re: Strange numbers to AS
  • Index(es):
    • Date
    • Thread