|
|
|
|
@ -319,7 +319,12 @@ void FunctionsTest::denormalizeUnsigned() {
|
|
|
|
|
CORRADE_COMPARE(Math::denormalize<UnsignedInt>(1.0), std::numeric_limits<UnsignedInt>::max()); |
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(Math::denormalize<UnsignedLong>(0.0l), 0); |
|
|
|
|
CORRADE_COMPARE(Math::denormalize<UnsignedLong>(1.0l), std::numeric_limits<UnsignedLong>::max()); |
|
|
|
|
{ |
|
|
|
|
#ifdef CORRADE_MSVC2015_COMPATIBILITY |
|
|
|
|
CORRADE_EXPECT_FAIL("Long double (de)normalization is broken on MSVC <= 2015."); |
|
|
|
|
#endif |
|
|
|
|
CORRADE_COMPARE(Math::denormalize<UnsignedLong>(1.0l), std::numeric_limits<UnsignedLong>::max()); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(Math::denormalize<UnsignedShort>(0.33f), 21626); |
|
|
|
|
@ -342,9 +347,19 @@ void FunctionsTest::denormalizeSigned() {
|
|
|
|
|
CORRADE_COMPARE(Math::denormalize<Int>(0.0), 0); |
|
|
|
|
CORRADE_COMPARE(Math::denormalize<Int>(1.0), std::numeric_limits<Int>::max()); |
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(Math::denormalize<Long>(-1.0l), std::numeric_limits<Long>::min()+1); |
|
|
|
|
{ |
|
|
|
|
#ifdef CORRADE_MSVC2015_COMPATIBILITY |
|
|
|
|
CORRADE_EXPECT_FAIL("Long double (de)normalization is broken on MSVC <= 2015."); |
|
|
|
|
#endif |
|
|
|
|
CORRADE_COMPARE(Math::denormalize<Long>(-1.0l), std::numeric_limits<Long>::min()+1); |
|
|
|
|
} |
|
|
|
|
CORRADE_COMPARE(Math::denormalize<Long>(0.0l), 0); |
|
|
|
|
CORRADE_COMPARE(Math::denormalize<Long>(1.0l), std::numeric_limits<Long>::max()); |
|
|
|
|
{ |
|
|
|
|
#ifdef CORRADE_MSVC2015_COMPATIBILITY |
|
|
|
|
CORRADE_EXPECT_FAIL("Long double (de)normalization is broken on MSVC <= 2015."); |
|
|
|
|
#endif |
|
|
|
|
CORRADE_COMPARE(Math::denormalize<Long>(1.0l), std::numeric_limits<Long>::max()); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(Math::denormalize<Short>(-0.33f), -10813); |
|
|
|
|
@ -365,7 +380,12 @@ void FunctionsTest::renormalizeUnsinged() {
|
|
|
|
|
CORRADE_COMPARE(Math::normalize<Double>(Math::denormalize<UnsignedInt>(1.0)), 1.0); |
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(Math::normalize<long double>(Math::denormalize<UnsignedLong>(0.0l)), 0.0l); |
|
|
|
|
CORRADE_COMPARE(Math::normalize<long double>(Math::denormalize<UnsignedLong>(1.0l)), 1.0l); |
|
|
|
|
{ |
|
|
|
|
#ifdef CORRADE_MSVC2015_COMPATIBILITY |
|
|
|
|
CORRADE_EXPECT_FAIL("Long double (de)normalization is broken on MSVC <= 2015."); |
|
|
|
|
#endif |
|
|
|
|
CORRADE_COMPARE(Math::normalize<long double>(Math::denormalize<UnsignedLong>(1.0l)), 1.0l); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -385,7 +405,12 @@ void FunctionsTest::renormalizeSinged() {
|
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(Math::normalize<long double>(Math::denormalize<Long>(-1.0l)), -1.0l); |
|
|
|
|
CORRADE_COMPARE(Math::normalize<long double>(Math::denormalize<Long>(0.0l)), 0.0l); |
|
|
|
|
CORRADE_COMPARE(Math::normalize<long double>(Math::denormalize<Long>(1.0l)), 1.0l); |
|
|
|
|
{ |
|
|
|
|
#ifdef CORRADE_MSVC2015_COMPATIBILITY |
|
|
|
|
CORRADE_EXPECT_FAIL("Long double (de)normalization is broken on MSVC <= 2015."); |
|
|
|
|
#endif |
|
|
|
|
CORRADE_COMPARE(Math::normalize<long double>(Math::denormalize<Long>(1.0l)), 1.0l); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|