@@ -51,7 +51,7 @@ is_error(double x)
5151 * the result for zero suffices to distinguish the cases).
5252 */
5353 if (x )
54- PyErr_SetString (PyExc_OverflowError ,
54+ PyErr_SetString (PyExc_OverflowError ,
5555 "math range error" );
5656 else
5757 result = 0 ;
@@ -109,25 +109,28 @@ math_2(PyObject *args, double (*func) (double, double), char *argsfmt)
109109 static char math_##funcname##_doc [] = docstring;
110110
111111FUNC1 (acos , acos ,
112- "acos(x)\n\nReturn the arc cosine of x." )
112+ "acos(x)\n\nReturn the arc cosine (measured in radians) of x." )
113113FUNC1 (asin , asin ,
114- "asin(x)\n\nReturn the arc sine of x." )
114+ "asin(x)\n\nReturn the arc sine (measured in radians) of x." )
115115FUNC1 (atan , atan ,
116- "atan(x)\n\nReturn the arc tangent of x." )
116+ "atan(x)\n\nReturn the arc tangent (measured in radians) of x." )
117117FUNC2 (atan2 , atan2 ,
118- "atan2(y, x)\n\nReturn atan(y/x)." )
118+ "atan2(y, x)\n\nReturn the arc tangent (measured in radians) of y/x.\n"
119+ "Unlike atan(y/x), the signs of both x and y are considered." )
119120FUNC1 (ceil , ceil ,
120- "ceil(x)\n\nReturn the ceiling of x as a real." )
121+ "ceil(x)\n\nReturn the ceiling of x as a float.\n"
122+ "This is the smallest integral value >= x." )
121123FUNC1 (cos , cos ,
122- "cos(x)\n\nReturn the cosine of x." )
124+ "cos(x)\n\nReturn the cosine of x (measured in radians) ." )
123125FUNC1 (cosh , cosh ,
124126 "cosh(x)\n\nReturn the hyperbolic cosine of x." )
125127FUNC1 (exp , exp ,
126128 "exp(x)\n\nReturn e raised to the power of x." )
127129FUNC1 (fabs , fabs ,
128- "fabs(x)\n\nReturn the absolute value of the real x." )
130+ "fabs(x)\n\nReturn the absolute value of the float x." )
129131FUNC1 (floor , floor ,
130- "floor(x)\n\nReturn the floor of x as a real." )
132+ "floor(x)\n\nReturn the floor of x as a float.\n"
133+ "This is the largest integral value <= x." )
131134FUNC2 (fmod , fmod ,
132135 "fmod(x,y)\n\nReturn fmod(x, y), according to platform C."
133136 " x % y may differ." )
@@ -139,19 +142,19 @@ FUNC1(log10, log10,
139142 "log10(x)\n\nReturn the base-10 logarithm of x." )
140143#ifdef MPW_3_1 /* This hack is needed for MPW 3.1 but not for 3.2 ... */
141144FUNC2 (pow , power ,
142- "pow(x,y)\n\nReturn x**y." )
145+ "pow(x,y)\n\nReturn x**y (x to the power of y) ." )
143146#else
144147FUNC2 (pow , pow ,
145- "pow(x,y)\n\nReturn x**y." )
148+ "pow(x,y)\n\nReturn x**y (x to the power of y) ." )
146149#endif
147150FUNC1 (sin , sin ,
148- "sin(x)\n\nReturn the sine of x." )
151+ "sin(x)\n\nReturn the sine of x (measured in radians) ." )
149152FUNC1 (sinh , sinh ,
150153 "sinh(x)\n\nReturn the hyperbolic sine of x." )
151154FUNC1 (sqrt , sqrt ,
152155 "sqrt(x)\n\nReturn the square root of x." )
153156FUNC1 (tan , tan ,
154- "tan(x)\n\nReturn the tangent of x." )
157+ "tan(x)\n\nReturn the tangent of x (measured in radians) ." )
155158FUNC1 (tanh , tanh ,
156159 "tanh(x)\n\nReturn the hyperbolic tangent of x." )
157160
@@ -198,7 +201,7 @@ math_ldexp(PyObject *self, PyObject *args)
198201 return PyFloat_FromDouble (x );
199202}
200203
201- static char math_ldexp_doc [] =
204+ static char math_ldexp_doc [] =
202205"ldexp_doc(x, i)\n\
203206\n\
204207Return x * (2**i)." ;
@@ -270,7 +273,7 @@ DL_EXPORT(void)
270273initmath (void )
271274{
272275 PyObject * m , * d , * v ;
273-
276+
274277 m = Py_InitModule3 ("math" , math_methods , module_doc );
275278 d = PyModule_GetDict (m );
276279
0 commit comments