aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorGuilherme Andrade <[email protected]>2017-04-20 21:53:54 +0100
committerGuilherme Andrade <[email protected]>2017-04-20 22:53:54 +0100
commit5ad95cca3f3c6802cd71fdd35dd397c3a37dc239 (patch)
tree2f9f01d21c2f22540a9b2419fb5be670ff8d0374 /erts/emulator
parent1b37d0b010ea31b04b9d0a15d0bec9c75a013dc9 (diff)
downloadotp-5ad95cca3f3c6802cd71fdd35dd397c3a37dc239.tar.gz
otp-5ad95cca3f3c6802cd71fdd35dd397c3a37dc239.tar.bz2
otp-5ad95cca3f3c6802cd71fdd35dd397c3a37dc239.zip
erts: Fix random floats in enif_phash2 tests
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/test/nif_SUITE.erl4
1 files changed, 1 insertions, 3 deletions
diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl
index f868b018c9..9127a5eae9 100644
--- a/erts/emulator/test/nif_SUITE.erl
+++ b/erts/emulator/test/nif_SUITE.erl
@@ -2627,13 +2627,11 @@ nif_phash2(Config) ->
end,
Terms).
--define(HALF_DBL_EPSILON, 1.1102230246251565e-16). % math:pow(2, -53)
-
random_term() ->
case rand:uniform(6) of
1 -> rand:uniform(1 bsl 27) - 1; % small
2 -> (1 bsl 27) + rand:uniform(1 bsl 128); % big
- 3 -> random_sign() * (rand:uniform() * ?HALF_DBL_EPSILON); % float
+ 3 -> random_sign() * (rand:uniform() * (1 bsl 53)); % float
4 -> random_binary();
5 -> random_pid();
6 ->