Re: Inconsistent results from Finder and System Events
Re: Inconsistent results from Finder and System Events
- Subject: Re: Inconsistent results from Finder and System Events
- From: Christopher Nebel <email@hidden>
- Date: Wed, 19 Nov 2003 14:04:42 -0800
On Nov 18, 2003, at 6:21 PM, kai wrote:
on Tue, 18 Nov 2003 16:07:07 -0800, Christopher Nebel wrote:
Integers in AppleScript are 27 bits long; anything bigger than that
(about 134M) gets turned into a real on receipt.
I get the same results from this in OS 10.2.8 and OS 9 (AS 1.8.3):
-----------
set l to {}
tell 512 * (2 ^ 20) - 2 as unsigned integer to repeat with n from 0 to
2
tell it + n to set l's end to {its class, it}
end repeat
l
-----------
--> {{integer, 536870910}, {integer, 536870911}, {real, 5.36870912E+8}}
Right. I had my bit lengths wrong -- I knew something was fishy with
that 134M number. AppleScript integers are 30-bit twos-complement
integers, which means you've got 29 bits of magnitude to play with, or
about 500 million. Any operations that produce results outside that
range get turned into reals. (At least, they're supposed to. There
have been bugs with that in the past.)
--Chris Nebel
AppleScript Engineering
_______________________________________________
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.