summaryrefslogtreecommitdiff
path: root/Modules/cmathmodule.c
AgeCommit message (Collapse)AuthorLines
2015-06-23Issue #24489: ensure a previously set C errno doesn't disturb cmath.polar().Antoine Pitrou-1/+2
2015-01-11Issue #21902: Replace incorrect 'hyperbolic arc sine' (etc.) with 'inverse ↵Mark Dickinson-3/+3
hyperbolic sine' (etc.). Remove meaningless reference to radians.
2013-07-20Issue #18513: Add workaround for OS X 10.8 cexp bug that leads to wrong ↵Raymond Hettinger-0/+7
cmath.rect(0.0,-0.0) results.
2011-03-16#11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti-1/+1
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-741/+741
2009-12-21Issue #7518: Move substitute definitions of C99 math functions fromMark Dickinson-5/+6
pymath.c to Modules/_math.c.
2009-08-04Issue #6644: Fix compile error on AIX.Mark Dickinson-1/+1
2009-02-28Issue #5393: typo in cmath.cos and cmath.cosh docstringMark Dickinson-2/+2
2008-07-05Minor rewrite of cmath_log to work around a Sun compiler bug. See issueMark Dickinson-2/+4
#3168.
2008-05-16Following Amaury's adviceChristian Heimes-1/+1
2008-05-16Fixed #2870: cmathmodule.c compile errorChristian Heimes-1/+1
2008-04-20Even more fixes for alpha Tru64, this time forMark Dickinson-1/+10
the phase and polar methods.
2008-04-20Issue 2662: Initialize special value tables dynamically (i.e. whenMark Dickinson-109/+128
cmath module is loaded) instead of statically. This fixes compile-time problems on platforms where HUGE_VAL is an extern variable rather than a constant. Thanks Hirokazu Yamamoto for the patch.
2008-04-18I finally got the time to update and merge Mark's and my trunk-math branch. ↵Christian Heimes-133/+886
The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math. The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :)
2006-01-19Check return result from Py_InitModule*(). This API can fail.Neal Norwitz-0/+2
Probably should be backported.
2004-06-14Patch #826074: cmath.log optional base argument, fixes #823209Raymond Hettinger-7/+27
(Contributed by Andrew Gaul.)
2002-08-02Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond-1/+1
for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
2002-07-17staticforward bites the dust.Jeremy Hylton-3/+3
The staticforward define was needed to support certain broken C compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the static keyword when it was used with a forward declaration of a static initialized structure. Standard C allows the forward declaration with static, and we've decided to stop catering to broken C compilers. (In fact, we expect that the compilers are all fixed eight years later.) I'm leaving staticforward and statichere defined in object.h as static. This is only for backwards compatibility with C extensions that might still use it. XXX I haven't updated the documentation.
2002-06-13Patch #568124: Add doc string macros.Martin v. Löwis-34/+34
2002-04-01Use the PyModule_*() API instead of manipulating the module dictionaryFred Drake-7/+5
directly.
2002-03-09SF bug 525705: [2.2] underflow raise OverflowException.Tim Peters-2/+1
Another year in the quest to out-guess random C behavior. Added macros Py_ADJUST_ERANGE1(X) and Py_ADJUST_ERANGE2(X, Y). The latter is useful for functions with complex results. Two corrections to errno- after-libm-call are attempted: 1. If the platform set errno to ERANGE due to underflow, clear errno. Some unknown subset of libm versions and link options do this. It's allowed by C89, but I never figured anyone would do it. 2. If the platform did not set errno but overflow occurred, force errno to ERANGE. C89 required setting errno to ERANGE, but C99 doesn't. Some unknown subset of libm versions and link options do it the C99 way now. Bugfix candidate, but hold off until some Linux people actually try it, with and without -lieee. I'll send a help plea to Python-Dev.
2001-09-06Revert parts of patch #453627, documenting the resulting test failuresMartin v. Löwis-18/+2
instead.
2001-09-05Rework the way we try to check for libm overflow, given that C99 no longerTim Peters-15/+2
requires that errno ever get set, and it looks like glibc is already playing that game. New rules: + Never use HUGE_VAL. Use the new Py_HUGE_VAL instead. + Never believe errno. If overflow is the only thing you're interested in, use the new Py_OVERFLOWED(x) macro. If you're interested in any libm errors, use the new Py_SET_ERANGE_IF_OVERFLOW(x) macro, which attempts to set errno the way C89 said it worked. Unfortunately, none of these are reliable, but they work on Windows and I *expect* under glibc too.
2001-09-05Patch #453627: Define the following macros when compiling on a UnixWare 7.x ↵Martin v. Löwis-2/+18
system: SCO_ATAN2_BUG, SCO_ACCEPT_BUG, and STRICT_SYSV_CURSES. Work aroudn a bug in the SCO UnixWare atan2() implementation.
2001-02-22asin micro-optimization suggested in email.Tim Peters-2/+3
2001-02-21Bug #133297: cmath.asin is the same as cmath.asinh.Tim Peters-8/+9
The bug report title isn't correct, but was on the right track. Rev 2.13 applied a patch intended to improve asinh and acosh, but the author mistakenly replaced the body of asin with their new code for asinh. See bug report for all the gory details. This patch: (a) puts the "new" (as of 2.13) asinh code into the asinh function; and, (b) repairs asin via what Abramowitz & Stegun say it should be (which is probably the same as what 2.12 did for asin, although I got tired of matching parentheses before being 100% sure of that -- and I don't care! The source of the old code is a mystery, and I *know* why I picked the new code.).
2001-02-20Rename some constants for easier readability.Tim Peters-8/+8
2001-02-20Mechanical edits just so I can read it.Tim Peters-142/+138
2000-08-03Use METH_VARARGS instead of numeric constant 1 in method def. tablesAndrew M. Kuchling-16/+32
2000-07-31merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp-2/+0
marked my*.h as obsolete
2000-07-24Fix typo in previous patch.Thomas Wouters-3/+3
2000-07-24*** empty log message ***Thomas Wouters-3/+3
2000-07-21Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters-2/+2
and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
2000-07-10ANSI-ficationPeter Schneider-Kamp-38/+19
2000-07-09Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters-1/+1
2000-06-30Patch by Nadav Horesh to make acosh and asinh better.Guido van Rossum-7/+12
Tim posted a long comment to python-dev (subject: "Controversial patch (cmath)"; date: 6/29/00). The conclusion is that this whole module stinks and this patch isn't perfect, but it's better than the acosh and asinh we had, so let's check it in.
1999-03-16Docstring fix: acosh() returns the hyperbolic arccosine, not theFred Drake-1/+1
hyperbolic cosine. Problem report via David Ascher by one of his students.
1999-01-14Jim Ahlstrom patch: Watcom chokes on a long expression in c_asinh().Guido van Rossum-1/+5
Break it up.
1998-12-04Added Doc strings -- by Chris Petrilli.Guido van Rossum-17/+119
1998-12-04Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum-1/+1
on BeOS or Windows.
1997-03-14New form of PyFPE_END_PROTECT macro.Guido van Rossum-1/+1
1997-02-14Changes for Lee Busby's SIGFPE patch set.Guido van Rossum-0/+2
Two new modules fpectl and fpetest. Surround various and sundry f.p. operations with PyFPE_*_PROTECT macros.
1996-12-10Removed redundant inclusion of <errno.h> (sorry, Roj!).Guido van Rossum-2/+0
1996-12-09Renamed GrandlyRoger E. Masse-19/+19
1996-12-05Keep gcc -Wall happy.Guido van Rossum-0/+2
1996-07-21complex -> Py_complexGuido van Rossum-56/+56
1996-05-24Made all c_* symbols static.Guido van Rossum-20/+20
1996-01-12complex mathGuido van Rossum-0/+314