Re: Converting binary to decimal
Re: Converting binary to decimal
- Subject: Re: Converting binary to decimal
- From: Emmanuel <email@hidden>
- Date: Tue, 4 Jan 2005 10:25:20 +0100
At 10:11 AM +0100 04/01/05, jj wrote:
> At 1:59 AM -0200 04/01/05, Bernardo Hoehl wrote:
>> Has anyone ever written a handler to convert binary to decimal?
>
> Here is one:
>
> ----------------
> write the_binary to f
> set the_decimal to (read f as real)
> ----------------
>
> Emmanuel
> _____________
Hmmm... If I provide "00000101" as input, it returns 0?
I had (erroneously, maybe) taken the question as "convert
binary-coded decimal to decimal". Sorry for the noise. I used this
occasion to emphasize something not widely known: AppleScript
conforms quite strictly IEEE when storing numbers (integers and real
numbers) in files.
If someone is interested, I think Satimage-software's site proposes
one of the most relevant pages on that topic:
<http://www.satimage.fr/software/en/as_data_files.html>
Emmanuel
From Satimage-software.
_______________________________________________
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