Problem with 64 bit FP under ARM
Bjorn Gustavsson
bjorn@REDACTED
Tue Aug 26 10:10:07 CEST 2003
Martin Sandiford <ms@REDACTED> writes:
> Hello all,
>
> I have a problem with 64 bit floating point numbers on an embedded
> SA1110 based machine running under Linux.
>
> A summary of the problem:
>
> (Running under Linux on x86):
> 1> <<1.0:64/float>>.
> <<63,240,0,0,0,0,0,0>>
> (Pretty much as expected for a little endian machine)
This is the expected result on ANY machine. The default endian
is big, so <<1.0:64/float>> is just shorthand for <<1.0:64/big-float>>.
To get the native ordering, you could use <<1.0:64/native-float>>.
> I'm not an ARM expert, so I can only assume that the correct
> representation for a double on ARM is with the quads swapped with
> respect to "normal" LE ordering. Does anyone here know if this is the
> case? I'm thinking it maybe could be a problem with the FP emulator?
> (There is no FPU on this board).
>
I don't know anything about the ARM.
It would be interesting if you could post the result of:
<<1.0:64/native-float>>
That should show exactly how floating point numbers are stored
internally.
/Bjorn
--
Björn Gustavsson Ericsson Utvecklings AB
bjorn@REDACTED ÄT2/UAB/F/P
BOX 1505
+46 8 727 56 87 125 25 Älvsjö
More information about the erlang-questions
mailing list