• 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: get eof real?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get eof real?


  • Subject: Re: get eof real?
  • From: Emmanuel <email@hidden>
  • Date: Fri, 26 Sep 2003 23:58:55 +0200

At 8:44 AM -0700 26/09/03, Paul Berkowitz wrote:
>'double integer' is a real. It means it's a floating point, a 'double', not
>a standard integer.

It's minor, but I'm afraid this statement could be a little misleading. 'double integer' is not a floating point. What may have confused you is that when AppleScript has to make a double integer into a string, instead it makes it a real first.

There are two numeric classes that I know that are coded on 4 bytes: integer and small real.
There are two numeric classes that I know that are coded on 8 bytes: double integer and real.

"small real" and "real" use the binary coding of mantissa + exponent, exactly like FORTRAN did (oops, does): you can read real numbers from FORTRAN data files with AppleScript's "read as small real" or "read as real" (depending on what was stored).

Example:

---------------------------------------
set f to "" & (path to "temp") & ("make new name") -- Smilers, remove the last quotes
set n to open for access file f with write permission
repeat 2 times
write 255 to n
end repeat
close access n

read f for 8 as integer
--> {255, 255}

read f for 8 as small real
--> {3.57331108402828E-43, 3.57331108402828E-43}

read f for 8 as double integer
--> 1.095216660735E+12

read f for 8 as real
--> 5.41108926822131E-312
---------------------------------------

Emmanuel
_______________________________________________
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.

  • Follow-Ups:
    • Re: get eof real?
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: get eof real? (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: BBEdit to Entourage
  • Next by Date: Re: Mac OS X 10.2.8 and URL Access Scripting "download"
  • Previous by thread: Re: get eof real?
  • Next by thread: Re: get eof real?
  • Index(es):
    • Date
    • Thread