(We've had emulation for broken modfl before,
but it used aintl, which is not that common.)
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)
# 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)