We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d595b8 commit db3e924Copy full SHA for db3e924
test/test_dpd_conversions.cpp
@@ -38,10 +38,28 @@ void test()
38
BOOST_TEST(isnan(roundtrip(-std::numeric_limits<T>::signaling_NaN())));
39
}
40
41
+template <typename T>
42
+void test_float_range()
43
+{
44
+ std::mt19937_64 rng(42);
45
+ std::uniform_real_distribution<float> dist(std::numeric_limits<float>::min(),
46
+ std::numeric_limits<float>::max());
47
+
48
+ for (std::size_t i {}; i < 1024; ++i)
49
+ {
50
+ const T val {dist(rng)};
51
+ const T return_val {roundtrip(val)};
52
+ BOOST_TEST_EQ(val, return_val);
53
+ }
54
+}
55
56
int main()
57
{
58
test<decimal32>();
59
test<decimal32_fast>();
60
61
+ test_float_range<decimal32>();
62
+ test_float_range<decimal32_fast>();
63
64
return boost::report_errors();
65
0 commit comments