summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-04-15 14:09:31 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-04-15 14:09:31 +0000
commit55954f198635e48806cb76596014125260048264 (patch)
tree57f230c6482158594af0bede2ecaae0eb028f13a /numeric.c
parentfb189484f11842c8d45ba7469f6c64347beeadf3 (diff)
downloadperl-55954f198635e48806cb76596014125260048264.tar.gz
Big patch from Alan Burlison to make Solaris long doubles work.
(Also spreads more <stdlib.h> joy.) Needs backporting to metaconfig units and introducing the new symbols to non-Configure lands. p4raw-id: //depot/perl@19218
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index 14f593af71..7a60ce79a9 100644
--- a/numeric.c
+++ b/numeric.c
@@ -972,3 +972,19 @@ Perl_my_atof2(pTHX_ const char* orig, NV* value)
return s;
}
+#if ! defined(HAS_MODFL) && 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
+
+#if ! defined(HAS_FREXPL) && defined(HAS_ILOGBL) && defined(HAS_SCALBNL)
+long double
+Perl_my_frexpl(long double x, int *e) {
+ *e = x == 0.0L ? 0 : ilogbl(x) + 1;
+ return (scalbnl(x, -*e));
+}
+#endif