diff --git a/maths.cpp b/maths.cpp index 6ab5e70a..14084674 100644 --- a/maths.cpp +++ b/maths.cpp @@ -149,6 +149,11 @@ template uint32_t round_pow2 (uint32_t); template uint64_t round_pow2 (uint64_t); +//----------------------------------------------------------------------------- +template float PI; +template double PI; + + //----------------------------------------------------------------------------- // 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 diff --git a/test/maths.cpp b/test/maths.cpp index dfc34c79..d3721e91 100644 --- a/test/maths.cpp +++ b/test/maths.cpp @@ -114,8 +114,8 @@ main (int, char **) { CHECK_EQ (sign ( numeric_limits::infinity ()), 1); CHECK_EQ (sign (-numeric_limits::infinity ()), -1); - CHECK_EQ (to_degrees (PI), 180.0); CHECK_EQ (to_degrees (PI), 180.f); + CHECK_EQ (to_degrees (PI), 180.0); CHECK_EQ (to_radians (180.f), PI); CHECK_EQ (to_radians (180.0), PI);