Skip to content

Commit 371b0f1

Browse files
committed
Use new syntax for power of 2 float constants
1 parent 2d1432f commit 371b0f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/stdlib/src/rand.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,8 @@ for every possible N for the range.
647647
bc((V), ?BIT((N) - 1), N)).
648648

649649
%%-define(TWO_POW_MINUS53, (math:pow(2, -53))).
650-
-define(TWO_POW_MINUS53, 1.11022302462515657e-16).
650+
%%-define(TWO_POW_MINUS53, 1.11022302462515657e-16).
651+
-define(TWO_POW_MINUS53, 2#1.0#e-53).
651652

652653
%% =====================================================================
653654
%% Types
@@ -1290,6 +1291,8 @@ uniform_real() ->
12901291
%%-define(TWO_POW_MINUS110, (math:pow(2, -110))).
12911292
%%-define(TWO_POW_MINUS55, 2.7755575615628914e-17).
12921293
%%-define(TWO_POW_MINUS110, 7.7037197775489436e-34).
1294+
%%-define(TWO_POW_MINUS55, 2#1.0#e-55).
1295+
%%-define(TWO_POW_MINUS110, 2#1.0#e-110).
12931296
%%
12941297
-doc """
12951298
Generate a uniformly distributed random number `0.0 < X < 1.0`.

0 commit comments

Comments
 (0)