[erlang-questions] float to ieee -754 single and double representation

Tony Rogvall tony@REDACTED
Thu Apr 21 18:18:25 CEST 2011



On 21 apr 2011, at 17.02, Joe Armstrong wrote:

> Has anybody some Erlang code to convert an erlang float
> to an ieee-754 32 and 64 bit hex representation?
> 
> For 64-bit <<F/float>> appears to do the job, what about 32 bit?
> 
<<1.0:32/float>>.  
<<63,128,0,0>>
3> <<1.0:64/float>>.  
<<63,240,0,0,0,0,0,0>>

/Tony
> /Joe
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

"Have run Make so many times I dunno what's installed anymore"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110421/cc9d70bf/attachment.htm>


More information about the erlang-questions mailing list