maths: explicitly instantiate PI for float, double
This commit is contained in:
parent
bb1e87bb47
commit
7bc96bd60f
@ -149,6 +149,11 @@ template uint32_t round_pow2 (uint32_t);
|
|||||||
template uint64_t round_pow2 (uint64_t);
|
template uint64_t round_pow2 (uint64_t);
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
template float PI<float>;
|
||||||
|
template double PI<double>;
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Simple instantiations. Some functions aren't used internally to the library
|
// Simple instantiations. Some functions aren't used internally to the library
|
||||||
// so it's easier to instantiate early and check for broken code at library
|
// so it's easier to instantiate early and check for broken code at library
|
||||||
|
@ -114,8 +114,8 @@ main (int, char **) {
|
|||||||
CHECK_EQ (sign ( numeric_limits<double>::infinity ()), 1);
|
CHECK_EQ (sign ( numeric_limits<double>::infinity ()), 1);
|
||||||
CHECK_EQ (sign (-numeric_limits<double>::infinity ()), -1);
|
CHECK_EQ (sign (-numeric_limits<double>::infinity ()), -1);
|
||||||
|
|
||||||
CHECK_EQ (to_degrees (PI<double>), 180.0);
|
|
||||||
CHECK_EQ (to_degrees (PI<float>), 180.f);
|
CHECK_EQ (to_degrees (PI<float>), 180.f);
|
||||||
|
CHECK_EQ (to_degrees (PI<double>), 180.0);
|
||||||
CHECK_EQ (to_radians (180.f), PI<float>);
|
CHECK_EQ (to_radians (180.f), PI<float>);
|
||||||
CHECK_EQ (to_radians (180.0), PI<double>);
|
CHECK_EQ (to_radians (180.0), PI<double>);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user