Magnum/Math/TypeTraits.h file

Type traits.

Namespaces

namespace Magnum
Root namespace.
namespace Magnum::Math
Math library.

Classes

template<class T>
struct Magnum::Math::IsScalar new in 2019.10
Whether T is an arithmetic scalar type.
template<class T>
struct Magnum::Math::IsVector new in 2019.10
Whether T is an arithmetic vector type.
template<class T>
struct Magnum::Math::IsIntegral new in 2019.10
Whether T is integral.
template<class T>
struct Magnum::Math::IsFloatingPoint new in 2019.10
Whether T is floating-point.
template<class T>
struct Magnum::Math::IsUnitless new in 2019.10
Whether T is a unitless type.
template<class T>
struct Magnum::Math::TypeTraits
Traits class for builtin arithmetic types.

Typedefs

template<class T>
using UnderlyingTypeOf = typename Implementation::UnderlyingType<T>::Type new in 2019.10
Underlying type of a math type.

Functions

template<class T>
auto equal(T a, T b) -> std::enable_if<IsScalar<T>::value, bool>::type new in 2019.10
Equality comparison of scalar types.
template<class T>
auto notEqual(T a, T b) -> std::enable_if<IsScalar<T>::value, bool>::type new in 2019.10
Non-equality comparison of scalar types.

Defines

#define FLOAT_EQUALITY_PRECISION deprecated in 2020.06
Precision when testing floats for equality.
#define DOUBLE_EQUALITY_PRECISION deprecated in 2020.06
Precision when testing doubles for equality.
#define LONG_DOUBLE_EQUALITY_PRECISION deprecated in 2020.06
Precision when testing long doubles for equality.

Define documentation

#define FLOAT_EQUALITY_PRECISION

Precision when testing floats for equality.

They have "at least" 6 significant digits of precision, taking one digit less for more headroom.

#define DOUBLE_EQUALITY_PRECISION

Precision when testing doubles for equality.

They have "at least" 15 significant digits of precision, taking one digit less for more headroom.

#define LONG_DOUBLE_EQUALITY_PRECISION

Precision when testing long doubles for equality.

They have "at least" 18 significant digits of precision on platforms where it is 80-bit, and 15 on platforms where it is 64-bit, taking one digit less for more headroom.