From 9def7ba7f620e4f450cb800b2b097142a5008c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 7 Aug 2019 21:11:01 +0200 Subject: [PATCH] Math: add a long double pi for sincos tests. I hope nobody needs the others, haha. --- src/Magnum/Math/Constants.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Magnum/Math/Constants.h b/src/Magnum/Math/Constants.h index c51f7a2e6..d3f32c1a9 100644 --- a/src/Magnum/Math/Constants.h +++ b/src/Magnum/Math/Constants.h @@ -147,6 +147,17 @@ template struct Constants; #endif #ifndef DOXYGEN_GENERATING_OUTPUT +#ifndef CORRADE_TARGET_EMSCRIPTEN +template<> struct Constants { + /* Needed by Deg->Rad conversion, which is needed by a test for + __builtin_sincos. Hopefully nobody else needs those, so it's just pi. + 21-digit string representation gives back the same value on rountrip. + https://en.wikipedia.org/wiki/Extended_precision#Working_range + Value taken using Wolfram Alpha. 1.23456789012345678901 */ + static constexpr long double pi() { return 3.14159265358979323846l; } +}; +#endif + template<> struct Constants { Constants() = delete;