summaryrefslogtreecommitdiffstats
path: root/Objects/floatobject.c
Commit message (Collapse)AuthorAgeFilesLines
* merge Include/my*.h into Include/pyport.hPeter Schneider-Kamp2000-07-311-1/+0
| | | | marked my*.h as obsolete
* Remove legacy use of __SC__; no longer needed now that ANSI source isFred Drake2000-07-091-5/+0
| | | | the standard for Python implementation.
* ANSI-fication of the sources.Fred Drake2000-07-091-70/+29
|
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-091-3/+3
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The common technique for printing out a pointer has been to cast to a long and use the "%lx" printf modifier. This is incorrect on Win64 where casting to a long truncates the pointer. The "%p" formatter should be used instead. The problem as stated by Tim: > Unfortunately, the C committee refused to define what %p conversion "looks > like" -- they explicitly allowed it to be implementation-defined. Older > versions of Microsoft C even stuck a colon in the middle of the address (in > the days of segment+offset addressing)! The result is that the hex value of a pointer will maybe/maybe not have a 0x prepended to it. Notes on the patch: There are two main classes of changes: - in the various repr() functions that print out pointers - debugging printf's in the various thread_*.h files (these are why the patch is large) Closes SourceForge patch #100505.
* This patch addresses two main issues: (1) There exist some non-fatalFred Drake2000-06-291-10/+11
| | | | | | | | | | | | | | | | | | | | 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.
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-8/+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.)
* Marc-Andre's third try at this bulk patch seems to work (except thatGuido van Rossum2000-04-051-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | his copy of test_contains.py seems to be broken -- the lines he deleted were already absent). Checkin messages: New Unicode support for int(), float(), complex() and long(). - new APIs PyInt_FromUnicode() and PyLong_FromUnicode() - added support for Unicode to PyFloat_FromString() - new encoding API PyUnicode_EncodeDecimal() which converts Unicode to a decimal char* string (used in the above new APIs) - shortcuts for calls like int(<int object>) and float(<float obj>) - tests for all of the above Unicode compares and contains checks: - comparing Unicode and non-string types now works; TypeErrors are masked, all other errors such as ValueError during Unicode coercion are passed through (note that PyUnicode_Compare does not implement the masking -- PyObject_Compare does this) - contains now works for non-string types too; TypeErrors are masked and 0 returned; all other errors are passed through Better testing support for the standard codecs. Misc minor enhancements, such as an alias dbcs for the mbcs codec. Changes: - PyLong_FromString() now applies the same error checks as does PyInt_FromString(): trailing garbage is reported as error and not longer silently ignored. The only characters which may be trailing the digits are 'L' and 'l' -- these are still silently ignored. - string.ato?() now directly interface to int(), long() and float(). The error strings are now a little different, but the type still remains the same. These functions are now ready to get declared obsolete ;-) - PyNumber_Int() now also does a check for embedded NULL chars in the input string; PyNumber_Long() already did this (and still does) Followed by: Looks like I've gone a step too far there... (and test_contains.py seem to have a bug too). I've changed back to reporting all errors in PyUnicode_Contains() and added a few more test cases to test_contains.py (plus corrected the join() NameError).
* Many changes for Unicode, by Marc-Andre Lemburg.Guido van Rossum2000-03-101-8/+15
|
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-201-1/+1
| | | | compilation on NT Alpha. Mostly added casts etc.
* Implement the other easy thing: repr() of a float now uses %.17g,Guido van Rossum1999-12-231-6/+43
| | | | while str() uses %.12g as before.
* Mainlining the string_methods branch. See branch revision logBarry Warsaw1999-10-121-0/+51
| | | | messages for specific changes.
* Tim Peters writes:Guido van Rossum1999-05-061-7/+19
| | | | | | | | | | 1. Fixes float divmod so that the quotient it returns is always an integral value. 2. Fixes float % and float divmod so that the remainder always gets the right sign (the current code uses a "are the signs different?" test that doesn't work half the time <wink> when the product of the divisor and the remainder underflows to 0).
* Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; ifGuido van Rossum1999-03-191-5/+17
| | | | | a block cannot be freed, add its free items back to the free list. This is necessary to avoid leaking when Python is reinitialized later.
* Vladimir has restructured his code somewhat so that the blocks are nowGuido van Rossum1999-03-121-25/+50
| | | | | | | represented by an explicit structure. (There are still too many casts in the code, but that may be unavoidable.) Also added code so that with -vv it is very chatty about what it does.
* OK, try again. Vladimir gave me a fix for the alignment bus error,Guido van Rossum1999-03-121-7/+56
| | | | | so here's his patch again. This time it works (at least on Solaris, Linux and Irix).
* Alas, Vladimir's patch caused a bus error (probably doubleGuido van Rossum1999-03-111-56/+7
| | | | alignment?), and I didn't test it. Withdrawing it for now.
* Patch by Vladimir Marangoz to allow freeing of the allocated blocks ofGuido van Rossum1999-03-101-7/+56
| | | | floats on finalization.
* Hack suggested by Matthias Klose to pull in all relevant entry pointsGuido van Rossum1997-10-311-0/+10
| | | | | | in libmath.a so they are available to mathmodule.so (in case it is shared). While this still gets triggered on Solaris 2.x, this appears to be harmless there.
* Added _Fini() routines to free up some memoryGuido van Rossum1997-08-051-0/+6
|
* Faster floating point allocator, same idea as the int allocator.Guido van Rossum1997-05-131-7/+29
| | | | By Aaron Watters.
* Quickly renamed the last directory.Guido van Rossum1997-05-021-115/+116
|
* New form of PyFPE_END_PROTECT macro.Guido van Rossum1997-03-141-10/+10
|
* Changes for Lee Busby's SIGFPE patch set.Guido van Rossum1997-02-141-4/+33
| | | | Surround various f.p. operations with PyFPE_{START,END}_PROTECT macros.
* New, better hash for floating point and complexGuido van Rossum1997-01-111-2/+9
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Get rid of bogus MSC_VER undef of CHECK()Guido van Rossum1996-09-111-4/+0
|
* Test for negative # to the nonintegral float power here.Guido van Rossum1996-08-161-15/+12
| | | | Expanded powi() in-line.
* Correct wrong calculation of pow(0.0, 0.0, negative_number)Guido van Rossum1996-08-091-5/+6
|
* Different logic for defining CHECK(); 16-bit MSC specific define.Guido van Rossum1996-06-261-2/+8
|
* make some things staticGuido van Rossum1996-05-241-2/+2
|
* better power implementationGuido van Rossum1996-01-121-18/+54
|
* for MPW __SC__ compilerGuido van Rossum1995-02-271-2/+6
|
* NeXT/Sparc 3.3 fixGuido van Rossum1995-02-131-1/+13
|
* use Py_CHARMASK; and don't check for neg. float to the float power hereGuido van Rossum1995-02-101-5/+1
|
* don't declare fmod/pow for any STDC compilerGuido van Rossum1995-01-171-1/+1
|
* Added 1995 to copyright message.Guido van Rossum1995-01-041-3/+3
| | | | | floatobject.c: fix hash(). methodobject.c: support METH_FREENAME flag bit.
* Lots of minor changes. Note for mappingobject.c: the hash table pointerGuido van Rossum1995-01-021-1/+0
| | | | can now be NULL.
* * Include/classobject.h, Objects/classobject.c, Python/ceval.c:Guido van Rossum1994-09-281-2/+17
| | | | | | | | | | | | | | | | | | entirely redone operator overloading. The rules for class instances are now much more relaxed than for other built-in types (whose coerce must still return two objects of the same type) * Objects/floatobject.c: add overflow check when converting float to int and implement truncation towards zero using ceil/float * Objects/longobject.c: change ValueError to OverflowError when converting to int * Objects/rangeobject.c: modernized * Objects/stringobject.c: use HAVE_LIMITS instead of __STDC__ * Objects/xxobject.c: changed to use new style (not finished?)
* New patches by Andrew to fix various problemsGuido van Rossum1994-08-121-5/+24
|
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-25/+54
|
* * Extended X interface: pixmap objects, colormap objects visual objects,Sjoerd Mullender1993-10-111-1/+1
| | | | | | | | image objects, and lots of new methods. * Added counting of allocations and deallocations of builtin types if COUNT_ALLOCS is defined. Had to move calls to NEWREF down in some files. * Bug fix in sorting lists.
* * Makefile: added all: and default: targets.Guido van Rossum1993-07-051-4/+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.
* * Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.Guido van Rossum1993-06-171-2/+2
| | | | | | | | | | 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().
* * Microscopic corrections to make things compile on the Cray APP.Guido van Rossum1993-04-071-0/+6
| | | | | * Removed one use of $> in Makefile and warned about others. Added configurable lines in Makefile to change CC and AR.
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-0/+33
| | | | | | | | | | | | | | | | | * Stubs for faster implementation of local variables (not yet finished) * Added function name to code object. Print it for code and function objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version number has changed accordingly) * Print address of self for built-in methods * New internal functions getattro and setattro (getattr/setattr with string object arg) * Replaced "dictobject" with more powerful "mappingobject" * New per-type functio tp_hash to implement arbitrary object hashing, and hashobject() to interface to it * Added built-in functions hash(v) and hasattr(v, 'name') * classobject: made some functions static that accidentally weren't; added __hash__ special instance method to implement hash() * Added proper comparison for built-in methods and functions
* * Changed many files to use mkvalue() instead of newtupleobject().Guido van Rossum1993-03-161-12/+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.
* Made builtins int(), long(), float(), oct() and hex() more generic.Guido van Rossum1992-09-121-0/+32
|