diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2015-02-05 08:08:51 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2015-02-05 08:16:28 -0500 |
commit | 19035550a20f1afe10fd7be779a304d822748c08 (patch) | |
tree | 74f9d0b8ad99699f49c667e81357c4c5d96bdbce /ext/POSIX/POSIX.xs | |
parent | dc7cecfbddf8ee041b6612a3aca232305f302c39 (diff) | |
download | perl-19035550a20f1afe10fd7be779a304d822748c08.tar.gz |
POSIX math: if long double, long double the math consts
Diffstat (limited to 'ext/POSIX/POSIX.xs')
-rw-r--r-- | ext/POSIX/POSIX.xs | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 1f7fdd9b12..b1118bd013 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -89,44 +89,63 @@ #else +# ifdef USE_LONG_DOUBLE +# undef M_E +# undef M_LOG2E +# undef M_LOG10E +# undef M_LN2 +# undef M_LN10 +# undef M_PI +# undef M_PI_2 +# undef M_PI_4 +# undef M_1_PI +# undef M_2_PI +# undef M_2_SQRTPI +# undef M_SQRT2 +# undef M_SQRT1_2 +# define FLOAT_C(c) CAT2(c,L) +# else +# define FLOAT_C(c) (c) +# endif + # ifndef M_E -# define M_E 2.71828182845904523536028747135266250 +# define M_E FLOAT_C(2.71828182845904523536028747135266250) # endif # ifndef M_LOG2E -# define M_LOG2E 1.44269504088896340735992468100189214 +# define M_LOG2E FLOAT_C(1.44269504088896340735992468100189214) # endif # ifndef M_LOG10E -# define M_LOG10E 0.434294481903251827651128918916605082 +# define M_LOG10E FLOAT_C(0.434294481903251827651128918916605082) # endif # ifndef M_LN2 -# define M_LN2 0.693147180559945309417232121458176568 +# define M_LN2 FLOAT_C(0.693147180559945309417232121458176568) # endif # ifndef M_LN10 -# define M_LN10 2.30258509299404568401799145468436421 +# define M_LN10 FLOAT_C(2.30258509299404568401799145468436421) # endif # ifndef M_PI -# define M_PI 3.14159265358979323846264338327950288 +# define M_PI FLOAT_C(3.14159265358979323846264338327950288) # endif # ifndef M_PI_2 -# define M_PI_2 1.57079632679489661923132169163975144 +# define M_PI_2 FLOAT_C(1.57079632679489661923132169163975144) # endif # ifndef M_PI_4 -# define M_PI_4 0.785398163397448309615660845819875721 +# define M_PI_4 FLOAT_C(0.785398163397448309615660845819875721) # endif # ifndef M_1_PI -# define M_1_PI 0.318309886183790671537767526745028724 +# define M_1_PI FLOAT_C(0.318309886183790671537767526745028724) # endif # ifndef M_2_PI -# define M_2_PI 0.636619772367581343075535053490057448 +# define M_2_PI FLOAT_C(0.636619772367581343075535053490057448) # endif # ifndef M_2_SQRTPI -# define M_2_SQRTPI 1.12837916709551257389615890312154517 +# define M_2_SQRTPI FLOAT_C(1.12837916709551257389615890312154517) # endif # ifndef M_SQRT2 -# define M_SQRT2 1.41421356237309504880168872420969808 +# define M_SQRT2 FLOAT_C(1.41421356237309504880168872420969808) # endif # ifndef M_SQRT1_2 -# define M_SQRT1_2 0.707106781186547524400844362104849039 +# define M_SQRT1_2 FLOAT_C(0.707106781186547524400844362104849039) # endif #endif |