summaryrefslogtreecommitdiff
path: root/Modules/cmathmodule.c
AgeCommit message (Collapse)AuthorLines
2002-03-11backport tim_one's checkin ofMichael W. Hudson-2/+1
revision 2.28 of cmathmodule.c SF bug 525705: [2.2] underflow raise OverflowException. 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