Re: get eof real?
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.