Removed constexpr from functions that use union cast.

This commit is contained in:
Branimir Karadžić
2018-11-26 10:03:19 -08:00
parent ccc1d4d3f8
commit b2acef05fd
2 changed files with 12 additions and 12 deletions

View File

@@ -59,37 +59,37 @@ namespace bx
return result;
}
inline constexpr BX_CONST_FUNC bool isNan(float _f)
inline BX_CONST_FUNC bool isNan(float _f)
{
const uint32_t tmp = floatToBits(_f) & INT32_MAX;
return tmp > UINT32_C(0x7f800000);
}
inline constexpr BX_CONST_FUNC bool isNan(double _f)
inline BX_CONST_FUNC bool isNan(double _f)
{
const uint64_t tmp = doubleToBits(_f) & INT64_MAX;
return tmp > UINT64_C(0x7ff0000000000000);
}
inline constexpr BX_CONST_FUNC bool isFinite(float _f)
inline BX_CONST_FUNC bool isFinite(float _f)
{
const uint32_t tmp = floatToBits(_f) & INT32_MAX;
return tmp < UINT32_C(0x7f800000);
}
inline constexpr BX_CONST_FUNC bool isFinite(double _f)
inline BX_CONST_FUNC bool isFinite(double _f)
{
const uint64_t tmp = doubleToBits(_f) & INT64_MAX;
return tmp < UINT64_C(0x7ff0000000000000);
}
inline constexpr BX_CONST_FUNC bool isInfinite(float _f)
inline BX_CONST_FUNC bool isInfinite(float _f)
{
const uint32_t tmp = floatToBits(_f) & INT32_MAX;
return tmp == UINT32_C(0x7f800000);
}
inline constexpr BX_CONST_FUNC bool isInfinite(double _f)
inline BX_CONST_FUNC bool isInfinite(double _f)
{
const uint64_t tmp = doubleToBits(_f) & INT64_MAX;
return tmp == UINT64_C(0x7ff0000000000000);

View File

@@ -88,27 +88,27 @@ namespace bx
/// Returns true if _f is a number that is NaN.
///
constexpr BX_CONST_FUNC bool isNan(float _f);
BX_CONST_FUNC bool isNan(float _f);
/// Returns true if _f is a number that is NaN.
///
constexpr BX_CONST_FUNC bool isNan(double _f);
BX_CONST_FUNC bool isNan(double _f);
/// Returns true if _f is not infinite and is not a NaN.
///
constexpr BX_CONST_FUNC bool isFinite(float _f);
BX_CONST_FUNC bool isFinite(float _f);
/// Returns true if _f is not infinite and is not a NaN.
///
constexpr BX_CONST_FUNC bool isFinite(double _f);
BX_CONST_FUNC bool isFinite(double _f);
/// Returns true if _f is infinite and is not a NaN.
///
constexpr BX_CONST_FUNC bool isInfinite(float _f);
BX_CONST_FUNC bool isInfinite(float _f);
/// Returns true if _f is infinite and is not a NaN.
///
constexpr BX_CONST_FUNC bool isInfinite(double _f);
BX_CONST_FUNC bool isInfinite(double _f);
/// Returns the largest integer value not greater than _f.
///