[erlang-questions] double to float

Per Hedeland <>
Fri Oct 19 01:19:32 CEST 2007


Tony Rogvall <> wrote:
>
>Erlang defaults to big endian (historical reasons) numbers that is  
>high order bytes first,

...in binaries. Yes but... - the important thing is that they *have* a
default endianness, and so binaries are "portable" unless you mess them
up. Whereas the file (written and) read with (fwrite() and) fread() from
C in the way Sten described cannot be fread() on a differently-endian
machine.

>for intel like machines they use low order bytes first.
>
>use  X/little-float

So, to emulate the non-portable C way, I guess that should be
X/native-float.

--Per Hedeland



More information about the erlang-questions mailing list