Re: Strange numbers to AS
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.