diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-03 22:32:26 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-03 22:32:26 (GMT) |
commit | eebb79cc690e8ab02cb7f630cfbc046df2c0f4da (patch) | |
tree | e6eae18d02015f5adb8535f3b69cf33e1ba9eb51 /Modules/mathmodule.c | |
parent | 000a074c955a1964959ee908300ef49b41170a06 (diff) | |
download | cpython-eebb79cc690e8ab02cb7f630cfbc046df2c0f4da.zip cpython-eebb79cc690e8ab02cb7f630cfbc046df2c0f4da.tar.gz cpython-eebb79cc690e8ab02cb7f630cfbc046df2c0f4da.tar.bz2 |
Added copysign(x, y) function to the math module
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r-- | Modules/mathmodule.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index 7540b5d..2c6262d 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -133,6 +133,14 @@ FUNC1(cos, cos, "cos(x)\n\nReturn the cosine of x (measured in radians).") FUNC1(cosh, cosh, "cosh(x)\n\nReturn the hyperbolic cosine of x.") +#if defined(MS_WINDOWS) || defined(HAVE_COPYSIGN) +#ifdef MS_WINDOWS +FUNC2(copysign, _copysign, +#else +FUNC2(copysign, copysign, +#endif + "copysign(x,y)\n\nReturn x with the sign of y."); +#endif FUNC1(exp, exp, "exp(x)\n\nReturn e raised to the power of x.") FUNC1(fabs, fabs, @@ -375,6 +383,9 @@ static PyMethodDef math_methods[] = { {"atan", math_atan, METH_O, math_atan_doc}, {"atan2", math_atan2, METH_VARARGS, math_atan2_doc}, {"ceil", math_ceil, METH_O, math_ceil_doc}, +#if defined(MS_WINDOWS) || defined(HAVE_COPYSIGN) + {"copysign", math_copysign, METH_VARARGS, math_copysign_doc}, +#endif {"cos", math_cos, METH_O, math_cos_doc}, {"cosh", math_cosh, METH_O, math_cosh_doc}, {"degrees", math_degrees, METH_O, math_degrees_doc}, |