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 c4eab90 commit 4a25581Copy full SHA for 4a25581
examples/basic_construction.cpp
@@ -40,6 +40,25 @@ int main()
40
std::cout << "Floats are not equal" << std::endl;
41
}
42
43
+ // Demonstration of the overflow and underflow handling
44
+ constexpr decimal64_t oveflow_value {100, 10000};
45
+ if (isinf(oveflow_value))
46
+ {
47
+ std::cout << "Overflow constructs infinity" << std::endl;
48
+ }
49
+
50
+ constexpr decimal64_t underflow_value {100, -10000};
51
+ if (underflow_value == 0)
52
53
+ std::cout << "Underflow constructs zero" << std::endl;
54
55
56
+ const decimal32_t non_finite_from_float {std::numeric_limits<double>::quiet_NaN()};
57
+ if (isnan(non_finite_from_float))
58
59
+ std::cout << "NaN constructs NaN" << std::endl;
60
61
62
return 0;
63
64
0 commit comments