[erlang-patches] Serge's ei float patch

Steve Vinoski <>
Tue Jun 1 09:06:52 CEST 2010

I've pushed an amended commit to github that I believe addresses all
your suggestions:

git fetch git://github.com/vinoski/otp.git serge_new_float_ext

Thanks to your feedback, I found a number of other places that needed
attention as part of this patch. If you could take another careful
look at the new changes, that would be good.

More comments below.

2010/5/31 Björn-Egil Dahlberg <>:
> On 2010-05-31 16:42, Steve Vinoski wrote:
>> 2010/5/31 Björn-Egil Dahlberg<>:
>>>  - Distribution flags, the DFLAG_NEW_FLOATS option should be enabled in
>>>   lib/erl_interface/src/connect/ei_connect.c: static int
>>> send_name_or_challenge.
>>>   See lib/erl_interface/src/connect/ei_connect_int.h and
>>> lib/kernel/src/dist.hrl for some details.
>> Does the recv_challenge function in ei_connect.c need to verify that
>> DFLAG_NEW_FLOATS is set in the flags, treating it as an error if not
>> set (e.g. the same way DFLAG_EXTENDED_REFERENCES is handled)?
> Right, need to ponder on that one. Should newer erl_interface be able to
> handle ancient erts? Well, it can't since encode_double will always encode
> with the new float. Hence yes, give them an error and let them upgrade
> erlang.
> This will be incompatible with releases before R12B.


>>> Anyway, with DFLAGS_NEW_FLOATS flag enabled the code would be tested as
>>> well
>>> which is a necessity in order for it to be included in the otp relase.
>> Which tests would exercise the DFLAGS_NEW_FLOATS flag?
>> Note that the code already submitted in this patch is definitely
>> tested by the erl_interface ei_print suite, since tests there were
>> failing with just the original R12B-2 patch.
> Perhaps that is what I saw in code coverage. I see now that for some vxworks
> reason the match_float is commented in the ei_encode/decode suites. It
> shouldn't be.

I reinstated these tests and modified them to match the style of other
tests in the same suite. I also found that match_float could
incorrectly fail when dealing with the float value 0.0 so I augmented
it with another function clause that allows for simple equality.


More information about the erlang-patches mailing list