summaryrefslogtreecommitdiff
path: root/Modules/mathmodule.c
AgeCommit message (Collapse)AuthorLines
2000-10-12Repaired a comment and asserted a precondition.Tim Peters-1/+2
2000-10-12Stop raising OverflowError on underflows reported by libm (errno==ERANGE andTim Peters-18/+42
libm result is 0). Cautiously add a few libm exception test cases: 1. That exp(-huge) returns 0 without exception. 2. That exp(+huge) triggers OverflowError. 3. That sqrt(-1) raises ValueError specifically (apparently under glibc linked with -lieee, it was raising OverflowError due to an accident of the way mathmodule.c's CHECK() macro happened to deal with Infs and NaNs under gcc).
2000-09-16Fixed legit gripe from c.l.py that math.fmod docs aren't confusing enough.Tim Peters-1/+2
FRED, please check my monkey-see-monkey-do Tex fiddling!
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-9/+0
This should match the situation in the 1.6b1 tree.
2000-09-01Do the absolute minimal amount of modifications to eradicateBarry Warsaw-2/+1
Py_FatalError() from module initialization functions. The importing mechanism already checks for PyErr_Occurred() after module importation and it Does The Right Thing. Unfortunately, the following either were not compiled or tested by the regression suite, due to issues with my development platform: almodule.c cdmodule.c mpzmodule.c puremodule.c timingmodule.c
2000-08-10remove all occurence of math.rint() from the sourcesPeter Schneider-Kamp-7/+0
(and yes, "Currintly" also counts <0.5 wink>)
2000-07-31merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp-2/+0
marked my*.h as obsolete
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-03Typo repair in docstring -- my fault.Tim Peters-1/+1
2000-07-03ANSI-fication, remove Py_PROTO, etc.Fred Drake-84/+74
Revise math_1(), math_2(), stub-generating macros, and function tables to use PyArg_ParseTuple() and properly provide the function name for error message generation. Fix pow() docstring for MPW 3.1; had said "power" instead of "pow".
2000-07-02Repair docs for math.frexp (they were wrong).Tim Peters-1/+3
Reported on c.l.py by Kirill Simonov.
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
2000-05-11The addition of rint() (by Peter Schneider-Kamp; I forgot to mentionGuido van Rossum-0/+4
that before) in the previous patch has one problem; rint() is not in the C math library on all platforms (e.g. not for VC++). Make it conditional on HAVE_RINT.
2000-05-11Added math.rint() -- round according to current IEEE754 modeGuido van Rossum-0/+3
2000-05-08Trent Mick:Guido van Rossum-4/+4
Fix overflow bug in ldexp(x, exp). The 'exp' argument maps to a C int for the math library call [double ldexp(double, int)], however the 'd' PyArg_ParseTuple formatter was used to yield a double, which was subsequently cast to an int. This could overflow. [GvR: mysteriously, on Solaris 2.7, ldexp(1, 2147483647) returns Inf while ldexp(1, 2147483646) raises OverflowError; this seems a bug in the math library (it also takes a real long time to compute the Inf outcome). Does this point to a bug in the CHECK() macro? It should have discovered that the result was outside the HUGE_VAL range.]
1998-12-08Correctly document atan2.Guido van Rossum-1/+1
1998-12-04Added Doc strings -- by Chris Petrilli.Guido van Rossum-49/+96
1998-12-04Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum-1/+1
on BeOS or Windows.
1997-05-20Removed MetroWerks workaround, replaced by defines in mymath.h (Jack)Guido van Rossum-5/+0
1997-03-14New form of PyFPE_END_PROTECT macro.Guido van Rossum-3/+3
1997-02-14Changes for Lee Busby's SIGFPE patch set.Guido van Rossum-0/+6
Two new modules fpectl and fpetest. Surround various and sundry f.p. operations with PyFPE_*_PROTECT macros.
1996-12-18Removed references to getdoublearg and get2doublearg rename macros andRoger E. Masse-8/+5
substituted the appropriate PyArg_Parse calls. Retested. All appears well.
1996-12-18Correct *another* mistake (initmath() always fell through to fatal error).Guido van Rossum-0/+1
Watch it, Barry! :-)
1996-12-18Correct 1-char typo / syntax error.Guido van Rossum-1/+1
1996-12-17Better error checking in initmath().Barry Warsaw-2/+13
1996-12-09RenamedBarry Warsaw-43/+42
1996-10-25New permission notice, includes CNRI.Guido van Rossum-12/+19
1996-08-29Move backup definition for hypot() to Python/hypot.c.Guido van Rossum-27/+0
1996-08-21Avoid complaint about inconsistent hypot() linkage on NT.Guido van Rossum-0/+2
1996-08-08Hack for Mac (where fabs is not usable as a function pointer).Guido van Rossum-0/+5
1996-07-30Don't make an exception for NeXT (BBUM says it's no longer needed).Guido van Rossum-1/+1
(But hypot() should really be defined in a separate file, triggered by configure.)
1996-05-23Microsoft C changesGuido van Rossum-1/+4
1996-01-12added default hypot() implementationGuido van Rossum-4/+21
1995-06-14NeXT doesn't like me to declare hypot(double, double)Guido van Rossum-1/+1
1995-03-01include mymath.hGuido van Rossum-1/+1
1995-01-22cleanupGuido van Rossum-4/+0
1995-01-12rearrange declarations somewhatGuido van Rossum-11/+11
1995-01-04Added 1995 to copyright message.Guido van Rossum-2/+2
Setup.in: clarified Tk comments somewhat. structmodule.c: use memcpy() instead of double precision assignment.
1995-01-02Another bulky set of minor changes.Guido van Rossum-0/+4
Note addition of gethostbyaddr() and improved repr() for sockets, renaming of md5.md5() to md5.new(), and fixing of leaks in threads.
1994-10-20add hypot()Guido van Rossum-0/+2
1994-08-01Merge alpha100 branch back to main trunkGuido van Rossum-1/+15
1993-07-05* Makefile: added all: and default: targets.Guido van Rossum-3/+0
* many files: made some functions static; removed "extern int errno;". * frozenmain.c: fixed bugs introduced on 24 June... * flmodule.c: remove 1.5 bw compat hacks, add new functions in 2.2a (and some old functions that were omitted). * timemodule.c: added MSDOS floatsleep version . * pgenmain.c: changed exit() to goaway() and added defn of goaway(). * intrcheck.c: add hack (to UNIX only) so interrupting 3 times will exit from a hanging program. The second interrupt prints a message explaining this to the user.
1993-06-17* Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.Guido van Rossum-0/+3
Added $(SYSDEF) to its build rule in Makefile. * cgensupport.[ch], modsupport.[ch]: removed some old stuff. Also changed files that still used it... And made several things static that weren't but should have been... And other minor cleanups... * listobject.[ch]: add external interfaces {set,get}listslice * socketmodule.c: fix bugs in new send() argument parsing. * sunaudiodevmodule.c: added flush() and close().
1993-04-07* Microscopic corrections to make things compile on the Cray APP.Guido van Rossum-0/+5
* Removed one use of $> in Makefile and warned about others. Added configurable lines in Makefile to change CC and AR.
1993-03-16* Changed many files to use mkvalue() instead of newtupleobject().Guido van Rossum-24/+4
* Fixcprt.py: added [-y file] option, do only files younger than file. * modsupport.[ch]: added vmkvalue(). * intobject.c: use mkvalue(). * stringobject.c: added "formatstring"; renamed string* to string_*; ceval.c: call formatstring for string % value. * longobject.c: close memory leak in divmod. * parsetok.c: set result node to NULL when returning an error.
1992-04-05Copyright for 1992 addedGuido van Rossum-1/+1
1992-03-27lintGuido van Rossum-1/+1
1992-02-26Get rid of RuntimeError.Guido van Rossum-1/+1
1992-01-14Get rid of AMOEBA deps; add declaration of fmod() if __STDC__ is not defined.Guido van Rossum-5/+4