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: Doug McNutt <email@hidden>
- Date: Sun, 13 Jun 2010 20:24:02 -0600
At 17:08 -0700 6/13/10, Michelle Steiner wrote:
>On Jun 13, 2010, at 4:59 PM, Deivy Petrescu wrote:
>
>> that is a problem with AppleScript number representation
>>
>> set x to 1,234,567,890 #(Commas added by DPM)
>> --obviously x is an integer
>> class of x
>> -->real
AppleScript uses a couple of bits at the top end of 32 bits for special purposes, one of which seems to be an indicator that this number needs to be treated as a float or double. It is apparently a very common procedure in other languages but I have never seen the details of such a thing.
In Applescript the largest positive signed integer is 2^29 -1 (536,870,911) rather that what you would expect, 2^31 -1 (2,147,483,647). Whonoze what happens in 64 bit hardware.
If someone in another environment declares a 32 bit word to be an unsigned integer that really is just a collection of 32 parameter flags there are going to be problems when Applescript sees such a thing and looks at the high order bits for flags that somehow demand conversion to a 52 bit floating point double.
I, for one, would really like to know the details. They are apparently Apple's secrets, likely patented. May the open source community take over the world! I just might live to see it.
--
Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
_______________________________________________
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