diff Modules/mathmodule.c @ 1746:1940892d2fe3 legacy-trunk

Merge alpha100 branch back to main trunk
author Guido van Rossum <guido@python.org>
date Mon, 01 Aug 1994 11:34:53 +0000
parents cd397266dc1c
children 58eef51e3084
line wrap: on
line diff
--- a/Modules/mathmodule.c	Mon Aug 01 11:18:30 1994 +0000
+++ b/Modules/mathmodule.c	Mon Aug 01 11:34:53 1994 +0000
@@ -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 @@
 #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_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 @@
 	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();