massemanet / eper

Erlang performance and debugging tools
MIT License
437 stars 128 forks source link

Erlang/OTP 27, +0.0 will no longer be exactly equal to -0.0 #60

Open Zabrane opened 1 year ago

Zabrane commented 1 year ago

Hi @massemanet Would you be able to fix the new strict [float checking](Erlang/OTP 27, +0.0 will no longer be exactly equal to -0.0)?

Eper can't compile anymore with Erlang 26.1 as you can see:

===> Compiling src/dtopConsumer.erl failed
src/dtopConsumer.erl:121:7: matching on the float 0.0 will no longer also match -0.0 in OTP 27. If you specifically intend to match 0.0 alone, write +0.0 instead.

The fix is very simple IMHO:

    case lks(beam_user,Sys,1)+lks(beam_kernel,Sys,0) of
      +0.0 -> 1;
      C -> C
    end,

Many thanks