[erlang-questions] erlang vs java floating point format

Ryan Rawson <>
Thu Aug 30 23:39:32 CEST 2007


Note that java floats are almost but not quite IEEE 754 floats.

Depending on the complexity of your problem domain you may not notice.  
This is one very dissapointing part of the java spec.



On Aug 30, 2007, at 9:56 AM, "Dave Rafkind" <>  
wrote:

> Hello great list!
>
> I am a newcomer to Erlang, so perhaps this is an easy question:
>
> If I send a java float to an Erlang process over TCP, I can match  
> against the resulting four bytes with
> something like
>
> <<FloatNumberFromJava:32/signed-big-float>>
>
> This seems to indicate that Erlang and Java floating point formats  
> are the same
> (at least for my setup which is Erlang 5.5.4, java 1.5 on an Intel/ 
> Linux box), which is
> IEEE 754:
> http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.2.3
>
> My question is, can this be reliably depended on to work across all  
> versions
> of Erlang and java and all supported architectures? Are the floating  
> point formats
> always guaranteed to be in sync?
>
>
> Thanks,
> Dave
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070830/a1cebe96/attachment.html>


More information about the erlang-questions mailing list