summaryrefslogtreecommitdiff
path: root/Objects/complexobject.c
AgeCommit message (Collapse)AuthorLines
2001-03-18SF bug [ #409448 ] Complex division is braindeadTim Peters-8/+58
http://sourceforge.net/tracker/?func=detail&aid=409448&group_id=5470&atid=105470 Now less braindead. Also added test_complex.py, which doesn't test much, but fails without this patch.
2001-03-11When 1.6 boosted the # of digits produced by repr(float), repr(complex)Tim Peters-8/+32
apparently forgot to play along. Make complex act like float.
2001-01-18Use rich comparisons to fulfill an old wish: complex numbers now raiseGuido van Rossum-49/+84
exceptions when compared using <, <=, > or >=. NOTE: This is a tentative change: this means that cmp() involving complex numbers will raise an exception when the numbers differ, and that in turn means that e.g. dictionaries and certain other compounds (e.g. UserLists) containing complex numbers can't be compared either. So we'll have to decide whether this is acceptable. The alpha test cycle is a good time to keep an eye on this!
2000-09-26Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake-4/+0
Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
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-08-15Fix for http://sourceforge.net/bugs/?func=detailbug&bug_id=111866&group_id=5470.Tim Peters-46/+17
This was a misleading bug -- the true "bug" was that hash(x) gave an error return when x is an infinity. Fixed that. Added new Py_IS_INFINITY macro to pyport.h. Rearranged code to reduce growing duplication in hashing of float and complex numbers, pushing Trent's earlier stab at that to a logical conclusion. Fixed exceedingly rare bug where hashing of floats could return -1 even if there wasn't an error (didn't waste time trying to construct a test case, it was simply obvious from the code that it *could* happen). Improved complex hash so that hash(complex(x, y)) doesn't systematically equal hash(complex(y, x)) anymore.
2000-07-31merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp-1/+0
marked my*.h as obsolete
2000-07-09ANSI-fication of the sources.Fred Drake-98/+48
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
2000-06-29This patch addresses two main issues: (1) There exist some non-fatalFred Drake-28/+9
errors in some of the hash algorithms. For exmaple, in float_hash and complex_hash a certain part of the value is not included in the hash calculation. See Tim's, Guido's, and my discussion of this on python-dev in May under the title "fix float_hash and complex_hash for 64-bit *nix" (2) The hash algorithms that use pointers (e.g. func_hash, code_hash) are universally not correct on Win64 (they assume that sizeof(long) == sizeof(void*)) As well, this patch significantly cleans up the hash code. It adds the two function _Py_HashDouble and _PyHash_VoidPtr that the various hashing routine are changed to use. These help maintain the hash function invariant: (a==b) => (hash(a)==hash(b))) I have added Lib/test/test_hash.py and Lib/test/output/test_hash to test this for some cases.
2000-05-03Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum-5/+6
For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
2000-02-29Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum-1/+1
PyArg_ParseTuple() format string arguments as possible.
2000-01-20The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum-1/+1
compilation on NT Alpha. Mostly added casts etc.
1999-01-25Ai! complex_nonzero() has && which should be ||, else decidedlyGuido van Rossum-1/+1
non-zero things like 5j and complex(1,0) are considered to be zero/false. Tim Peters.
1998-05-07Add check to conjugate() that there are no excess arguments.Guido van Rossum-2/+5
1997-05-20Got rid of c_error in favor of errno (and EDOM/ERANGE).Guido van Rossum-49/+43
Assume that errno usage is thread-safe -- most vendors do this by making in a macro that refers to a per-thread storage area.
1997-05-02Quickly renamed the last directory.Guido van Rossum-110/+108
1997-04-09Remove unused variable.Guido van Rossum-1/+0
1997-04-01Get rid of .conj pseudo data attribute for complex numbers.Guido van Rossum-5/+2
Add __members__ attribute.
1997-03-14New form of PyFPE_END_PROTECT macro.Guido van Rossum-6/+6
1997-02-14Changes for Lee Busby's SIGFPE patch set.Guido van Rossum-4/+24
Surround various f.p. operations with PyFPE_{START,END}_PROTECT macros.
1997-01-11New, better hash for floating point and complexGuido van Rossum-4/+32
1996-12-05Make gcc -Wall happyGuido van Rossum-14/+0
1996-09-12Oops... Need to clear c_error before calling c_quot().Guido van Rossum-0/+2
1996-09-12Properly(?) implemented remainder and divmod (Tim Hochberg)Guido van Rossum-5/+34
1996-09-11Raise exception instead of dropping imag part for conversion to int,Guido van Rossum-11/+9
long, float. Raise exception instead of dumping core for remainder and divmod.
1996-09-11Don't dump core on complex % or divmod -- raise a TypeError exception.Guido van Rossum-2/+14
1996-08-19Changes to make the file acceptable to K&R C compilers (HPUX, SunOS 4.x).Guido van Rossum-25/+38
1996-07-21complex -> Py_complexGuido van Rossum-40/+40
1996-05-24make some things staticGuido van Rossum-4/+4
1996-01-25use 'j' instead of 'i' for imaginary constantsGuido van Rossum-2/+2
1996-01-25Removed unused varJack Jansen-1/+0
1996-01-12Added PyComplex_AsCComplexGuido van Rossum-0/+12
1996-01-12complex numbers a la Konrad HinsenGuido van Rossum-0/+562