summaryrefslogtreecommitdiffstats
path: root/Modules/mathmodule.c
Commit message (Expand)AuthorAgeFilesLines
* SF patch #659536: Use PyArg_UnpackTuple where possible.Raymond Hettinger2002-12-291-2/+2
* Apply SF patch 652930: Add optional base argument to math.log(x[, base]).Raymond Hettinger2002-12-141-15/+47
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-18/+18
* Added degrees() and radians() to mathmodule. Closes patch 552452 andRaymond Hettinger2002-05-131-0/+27
* Revert parts of patch #453627, documenting the resulting test failuresMartin v. Löwis2001-09-061-17/+1
* Rework the way we try to check for libm overflow, given that C99 no longerTim Peters2001-09-051-29/+13
* Patch #453627: Define the following macros when compiling on a UnixWare 7.x s...Martin v. Löwis2001-09-051-1/+17
* loghelper(): Try to nudge the compiler into doing mults in an order thatTim Peters2001-09-051-1/+1
* Return reasonable results for math.log(long) and math.log10(long) (we wereTim Peters2001-09-051-4/+64
* Mechanical fiddling to make this easier to work with in my editor.Tim Peters2001-09-041-18/+12
* Part of SF patch [#431848] mathmodule.c: doc strings & conversion, fromTim Peters2001-08-071-15/+18
* annoying whitespace inconsistencyPeter Schneider-Kamp2001-06-101-1/+1
* Repaired a comment and asserted a precondition.Tim Peters2000-10-121-1/+2
* Stop raising OverflowError on underflows reported by libm (errno==ERANGE andTim Peters2000-10-121-18/+42
* Fixed legit gripe from c.l.py that math.fmod docs aren't confusing enough.Tim Peters2000-09-161-1/+2
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
* Do the absolute minimal amount of modifications to eradicateBarry Warsaw2000-09-011-2/+1
* remove all occurence of math.rint() from the sourcesPeter Schneider-Kamp2000-08-101-7/+0
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-311-2/+0
* Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters2000-07-211-2/+2
* Typo repair in docstring -- my fault.Tim Peters2000-07-031-1/+1
* ANSI-fication, remove Py_PROTO, etc.Fred Drake2000-07-031-84/+74
* Repair docs for math.frexp (they were wrong).Tim Peters2000-07-021-1/+3
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
* The addition of rint() (by Peter Schneider-Kamp; I forgot to mentionGuido van Rossum2000-05-111-0/+4
* Added math.rint() -- round according to current IEEE754 modeGuido van Rossum2000-05-111-0/+3
* Trent Mick:Guido van Rossum2000-05-081-4/+4
* Correctly document atan2.Guido van Rossum1998-12-081-1/+1
* Added Doc strings -- by Chris Petrilli.Guido van Rossum1998-12-041-50/+97
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
* Removed MetroWerks workaround, replaced by defines in mymath.h (Jack)Guido van Rossum1997-05-201-5/+0
* New form of PyFPE_END_PROTECT macro.Guido van Rossum1997-03-141-3/+3
* Changes for Lee Busby's SIGFPE patch set.Guido van Rossum1997-02-141-0/+6
* Removed references to getdoublearg and get2doublearg rename macros andRoger E. Masse1996-12-181-8/+5
* Correct *another* mistake (initmath() always fell through to fatal error).Guido van Rossum1996-12-181-0/+1
* Correct 1-char typo / syntax error.Guido van Rossum1996-12-181-1/+1
* Better error checking in initmath().Barry Warsaw1996-12-171-2/+13
* RenamedBarry Warsaw1996-12-091-43/+42
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
* Move backup definition for hypot() to Python/hypot.c.Guido van Rossum1996-08-291-27/+0
* Avoid complaint about inconsistent hypot() linkage on NT.Guido van Rossum1996-08-211-0/+2
* Hack for Mac (where fabs is not usable as a function pointer).Guido van Rossum1996-08-081-0/+5
* Don't make an exception for NeXT (BBUM says it's no longer needed).Guido van Rossum1996-07-301-1/+1
* Microsoft C changesGuido van Rossum1996-05-231-1/+4
* added default hypot() implementationGuido van Rossum1996-01-121-4/+21
* NeXT doesn't like me to declare hypot(double, double)Guido van Rossum1995-06-141-1/+1
* include mymath.hGuido van Rossum1995-03-011-1/+1
* cleanupGuido van Rossum1995-01-221-4/+0
rently expects that PyLong_SHIFT is a multiple of 15 - - - NSMALLNEGINTS and NSMALLPOSINTS should be small enough to fit in a single - digit; with the current values this forces PyLong_SHIFT >= 9 - - The values 15 and 30 should fit all of the above requirements, on any - platform. -*/ - -#if PYLONG_BITS_IN_DIGIT == 30 -typedef uint32_t digit; -typedef int32_t sdigit; /* signed variant of digit */ -typedef uint64_t twodigits; -typedef int64_t stwodigits; /* signed variant of twodigits */ -#define PyLong_SHIFT 30 -#define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */ -#define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */ -#elif PYLONG_BITS_IN_DIGIT == 15 -typedef unsigned short digit; -typedef short sdigit; /* signed variant of digit */ -typedef unsigned long twodigits; -typedef long stwodigits; /* signed variant of twodigits */ -#define PyLong_SHIFT 15 -#define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */ -#define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */ -#else -#error "PYLONG_BITS_IN_DIGIT should be 15 or 30" -#endif -#define PyLong_BASE ((digit)1 << PyLong_SHIFT) -#define PyLong_MASK ((digit)(PyLong_BASE - 1)) - -#if PyLong_SHIFT % 5 != 0 -#error "longobject.c requires that PyLong_SHIFT be divisible by 5" -#endif - -/* Long integer representation. - The absolute value of a number is equal to - SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i) - Negative numbers are represented with ob_size < 0; - zero is represented by ob_size == 0. - In a normalized number, ob_digit[abs(ob_size)-1] (the most significant - digit) is never zero. Also, in all cases, for all valid i, - 0 <= ob_digit[i] <= MASK. - The allocation function takes care of allocating extra memory - so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available. - - CAUTION: Generic code manipulating subtypes of PyVarObject has to - aware that ints abuse ob_size's sign bit. -*/ - -struct _longobject { - PyObject_VAR_HEAD - digit ob_digit[1]; -}; - -PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t); - -/* Return a copy of src. */ -PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src); - -#ifdef __cplusplus -} -#endif -#endif /* !Py_LONGINTREPR_H */ -#endif /* Py_LIMITED_API */ diff --git a/Makefile.pre.in b/Makefile.pre.in index 32bbab0..a81161e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1128,12 +1128,10 @@ PYTHON_HEADERS= \ $(srcdir)/Include/bytearrayobject.h \ $(srcdir)/Include/bytesobject.h \ $(srcdir)/Include/ceval.h \ - $(srcdir)/Include/classobject.h \ $(srcdir)/Include/code.h \ $(srcdir)/Include/codecs.h \ $(srcdir)/Include/compile.h \ $(srcdir)/Include/complexobject.h \ - $(srcdir)/Include/context.h \ $(srcdir)/Include/descrobject.h \ $(srcdir)/Include/dictobject.h \ $(srcdir)/Include/dynamic_annotations.h \ @@ -1144,13 +1142,11 @@ PYTHON_HEADERS= \ $(srcdir)/Include/fileutils.h \ $(srcdir)/Include/floatobject.h \ $(srcdir)/Include/frameobject.h \ - $(srcdir)/Include/genobject.h \ $(srcdir)/Include/import.h \ $(srcdir)/Include/interpreteridobject.h \ $(srcdir)/Include/intrcheck.h \ $(srcdir)/Include/iterobject.h \ $(srcdir)/Include/listo