Re: About integers
Re: About integers
- Subject: Re: About integers
- From: Doug McNutt <email@hidden>
- Date: Tue, 1 Mar 2005 12:19:29 -0700
At 11:10 -0500 3/1/05, francois.houle wrote:
>I was told that it should be possible to use applescript to add 32 bit
>unsigned integers to a text file
From the AppleScript Language Guide:
>The largest value that can be expressed as an integer in AppleScript is
>±536870909, which is equal to ±(2^29- 3). Larger integers (positive or negative)
>are converted to real numbers (expressed in exponential notation) when scripts
>are compiled.
What the extra three bits are used for remains a mystery but adding (in the arithmetic sense) 32 bit integers is likely to result in an unexpected 64 bit floating point result.
Appending a 32 bit item to a file may be a matter of writing 4 bytes that you have to prepare somehow and you won't find a type "unsigned char" to work with. Watch out for "helpful" conversions to Unicode of bytes > 127 (10).
You can "do shell script" a redirected echo of four hex-escaped bytes.
--
--> Marriage and kilo are troubled words. Turmoil results when centuries-old usage is altered in specialized jargon <--.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden