diff options
-rw-r--r-- | numeric.c | 12 | ||||
-rw-r--r-- | perl.h | 4 |
2 files changed, 12 insertions, 4 deletions
@@ -1347,13 +1347,23 @@ Perl_isinfnan(NV nv) return FALSE; } -#if ! defined(HAS_MODFL) && defined(HAS_AINTL) && defined(HAS_COPYSIGNL) +#ifndef HAS_MODFL +/* C99 has truncl, pre-C99 Solaris had aintl */ +# if defined(HAS_TRUNCL) && defined(HAS_COPYSIGNL) +long double +Perl_my_modfl(long double x, long double *ip) +{ + *ip = truncl(x); + return (x == *ip ? copysignl(0.0L, x) : x - *ip); +} +# elif defined(HAS_AINTL) && defined(HAS_COPYSIGNL) long double Perl_my_modfl(long double x, long double *ip) { *ip = aintl(x); return (x == *ip ? copysignl(0.0L, x) : x - *ip); } +# endif #endif #if ! defined(HAS_FREXPL) && defined(HAS_ILOGBL) && defined(HAS_SCALBNL) @@ -1912,11 +1912,9 @@ typedef NVTYPE NV; # ifndef HAS_MODFL_PROTO EXTERN_C long double modfl(long double, long double *); # endif -# else -# if defined(HAS_AINTL) && defined(HAS_COPYSIGNL) +# elif (defined(HAS_TRUNCL) || defined(HAS_AINTL)) && defined(HAS_COPYSIGNL) extern long double Perl_my_modfl(long double x, long double *ip); # define Perl_modf(x,y) Perl_my_modfl(x,y) -# endif # endif # ifdef HAS_FREXPL # define Perl_frexp(x,y) frexpl(x,y) |