summaryrefslogtreecommitdiffstats
path: root/Modules/mathmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-01 11:34:53 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-01 11:34:53 (GMT)
commitb6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af (patch)
tree9362939305b2d088b8f19a530c9015d886bc2801 /Modules/mathmodule.c
parent2979b01ff88ac4c5b316d9bf98edbaaaffac8e24 (diff)
downloadcpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.zip
cpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.tar.gz
cpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.tar.bz2
Merge alpha100 branch back to main trunk
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r--Modules/mathmodule.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 67e3cf7..4137e60 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -1,5 +1,5 @@
/***********************************************************
-Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
+Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
All Rights Reserved
@@ -40,9 +40,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#undef HUGE_VAL
#endif
+#ifndef macintosh
#ifndef __STDC__
extern double fmod PROTO((double, double));
#endif
+#endif
#ifdef HUGE_VAL
#define CHECK(x) if (errno != 0) ; \
@@ -132,10 +134,14 @@ FUNC1(math_sqrt, sqrt)
FUNC1(math_tan, tan)
FUNC1(math_tanh, tanh)
+#ifndef macintosh
+
double frexp PROTO((double, int *));
double ldexp PROTO((double, int));
double modf PROTO((double, double *));
+#endif
+
static object *
math_frexp(self, args)
object *self;
@@ -180,7 +186,15 @@ math_modf(self, args)
if (!getdoublearg(args, &x))
return NULL;
errno = 0;
+#ifdef MPW /* MPW C modf expects pointer to extended as second argument */
+{
+ extended e;
+ x = modf(x, &e);
+ y = e;
+}
+#else
x = modf(x, &y);
+#endif
CHECK(x);
if (errno != 0)
return math_error();