From 7c8562407fc1174f9c1a5ffbfb2298d1c3caa7ab Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 16 Dec 2014 15:29:26 +1100 Subject: [PATCH] rand: remove narrowing cast warning in test --- test/rand.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/rand.cpp b/test/rand.cpp index 041c5d89..e69e72c1 100644 --- a/test/rand.cpp +++ b/test/rand.cpp @@ -13,7 +13,7 @@ using namespace std; void test_bool (void) { static const unsigned ITERATIONS = 8192; - static const unsigned THRESHOLD = ITERATIONS * 0.1; + static const unsigned THRESHOLD = ITERATIONS / 10; unsigned counts[2] = { 0, 0 }; for (unsigned i = 0; i < ITERATIONS; ++i) @@ -33,7 +33,7 @@ test_float (void) { static const unsigned BUCKETS = 8; static const unsigned ITERATIONS = 8912; static const unsigned EXPECTED = ITERATIONS / BUCKETS; - static const float THRESHOLD = EXPECTED * 0.1; + static const float THRESHOLD = EXPECTED / 10; unsigned counts[BUCKETS] = { 0 }; for (unsigned i = 0; i < ITERATIONS; ++i)