Re: Binary conversion

new topic     » goto parent     » topic index » view thread      » older message » newer message

Not sure what you mean by "binary". I normally regard binary numbers as only
having ones and zeros. Thus {0,0,0,2} doesn't fit my idea of a binary number
'cos it has a '2' in it.

Or does this sequence represent a 4-byte number, with each element having
the range 0-255?

In that last case the atom could be ((((s[1] *
256)+s[2])*256)+s[3])*256)+s[4]

----------------
cheers,
Derek
----- Original Message -----
From: "Jonas Temple" <jktemple at yhti.net>
To: "EUforum" <EUforum at topica.com>
Sent: Friday, August 16, 2002 7:46 AM
Subject: Binary conversion


>
> Okay, I asked this a while back and now I've got a slightly different
> problem.
>
> If I have a sequence of {0,0,0,2} that is supposed to represent a binary
> number, how do I convert that to an atom?
>
> Jonas
>
>
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu