• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: About integers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: About integers
      • From: Christopher Nebel <email@hidden>
References: 
 >About integers (From: "francois.houle" <email@hidden>)

  • Prev by Date: Re: Beginner's scripting Terminal questions
  • Next by Date: Re: going from eudora to Mail
  • Previous by thread: Re: About integers
  • Next by thread: Re: About integers
  • Index(es):
    • Date
    • Thread