Made use of std::numeric_limits::is_iec559
This commit is contained in:
parent
e8da52f4c4
commit
bba1dc264b
1 changed files with 2 additions and 9 deletions
|
@ -1,18 +1,11 @@
|
|||
#include <cstdint>
|
||||
#include <limits>
|
||||
|
||||
// This test verifies that floating point numbers are represented in the IEEE 754 format.
|
||||
// Wesnoth requires that.
|
||||
int main()
|
||||
{
|
||||
union
|
||||
{
|
||||
double floating_point_number;
|
||||
uint64_t integer;
|
||||
} number;
|
||||
|
||||
number.floating_point_number = 1.2;
|
||||
bool match = (number.integer == 0x3FF3333333333333ull);
|
||||
// Return code zero means success.
|
||||
// Thus, check that the bit representation is *not* what IEEE 754 specifies.
|
||||
bool match = std::numeric_limits<double>::is_iec559;
|
||||
return !match;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue