[erlang-questions] Floating point conversion problem on big endian architecture

Stefan Hudelmaier stefan.hudelmaier@REDACTED
Thu Apr 7 16:09:28 CEST 2011


we're cross compiling Erlang/OTP on a x86 PC for ARM. On the resulting 
runtime on ARM we have the following strange problem: Converting float 
to binary seems to work fine, exactly as on x86:

 > B = <<3.2:32/big-float>>.
 > io:format("~w~n", [B]).

But converting back to float from this binary, yields the wrong result 
on ARM:

 > <<R:32/big-float>> = B.
 > R.

While on x86, it works as expected:

 > <<R:32/big-float>> = B.
 > R.

When compiling for ARM, we have set erl_xcomp_bigendian=yes. hipe is 
disabled. We have tried R14A and R14B02.

Please let me know, if there is any more information we need to provide.

Kind regards,

Device Insight GmbH
Stefan Hudelmaier, Dipl. Inf.
Willy-Brandt-Platz 3
D-81829 München

Tel.: 089 45 45 448 - 34
Email: stefan.hudelmaier@REDACTED


More information about the erlang-questions mailing list