Skip to content

Commit dd0cc33

Browse files
michaelklishinmergify[bot]
authored andcommitted
Try explicitly matching both 0.0 and -0.0
for OTP 27 compatibility. Without special casing 0.0, we end up with a math:log10/1 call which is undefined for zero. (cherry picked from commit 2f8473b)
1 parent 6b11682 commit dd0cc33

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deps/rabbit_common/src/rabbit_numerical.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
%% human-readable output, or compact ASCII serializations for floats.
3131
digits(N) when is_integer(N) ->
3232
integer_to_list(N);
33+
digits(0.0) ->
34+
"0.0";
35+
digits(-0.0) ->
36+
"0.0";
3337
digits(Float) ->
3438
{Frac1, Exp1} = frexp_int(Float),
3539
[Place0 | Digits0] = digits1(Float, Exp1, Frac1),

0 commit comments

Comments
 (0)