Re: iPhoto returns a real number as a photo id
Re: iPhoto returns a real number as a photo id
- Subject: Re: iPhoto returns a real number as a photo id
- From: has <email@hidden>
- Date: Wed, 16 Jun 2010 07:24:00 +0100
Shane Stanley wrote:
>> The 62 bit integers resides in 64 bit AS
>
> As far as I can see, an AS integer is limited to 2^29-1 in both 32-bit and
> 64-bit mode. Is there some evidence that it gets stored in 64 bits in 64-bit
> mode, or this 62-bit integer some new class?
Ehh. For some reason, was sure AS integers had greater range on 64-bit, but no; you're right; they're limited to -2^29 - 2^29-1 on both. My bad for not checking before posting. Probably confusing it with Python or Ruby, where integer max size is architecture dependent.
Ruby, incidentally, uses the same optimisation trick as AS for storing integers internally, although IIRC it only reserves a single bit, so can cover a slightly larger range. It also defines a conventional class, BigInt, which can represent integers of unlimited size, and switches between the two more or less transparently. So unlike AS, Ruby doesn't have the problem of whole numbers over a certain size having to be represented as floating point numbers instead, with the eventual loss of precision that entails.
has
--
Learn AppleScript, 3rd edition, Sanderson & Rosenthal:
http://apress.com/book/view/9781430223610
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden