summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_float.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix float.from_hex tests. It appears that Linux/ia64 doesn't likeMark Dickinson2008-07-151-4/+4
| | | | | computing 2.0**-1074 accurately. Using ldexp(1.0, -1074) should be safer.
* Issue #3008: add instance method float.hex and class method float.fromhexMark Dickinson2008-07-151-1/+386
| | | | to convert floats to and from hexadecimal strings respectively.
* Issue 3188: accept float('infinity') as well as float('inf'). ThisMark Dickinson2008-07-051-1/+17
| | | | | | makes the float constructor behave in the same way as specified by various other language standards, including C99, IEEE 754r, and the IBM Decimal standard.
* Moved testing of builtin types out of test_builtin and into type specific ↵Benjamin Peterson2008-05-031-0/+111
| | | | modules
* I finally got the time to update and merge Mark's and my trunk-math branch. ↵Christian Heimes2008-04-181-5/+16
| | | | | | The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math. The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :)
* Patch #1725 by Mark Dickinson, fixes incorrect conversion of -1e1000Guido van Rossum2008-01-051-0/+7
| | | | and adds errors for -0x.
* Applied patch #1635: Float patch for inf and nan on Windows (and other ↵Christian Heimes2007-12-181-1/+72
| | | | | | platforms). The patch unifies float("inf") and repr(float("inf")) on all platforms.
* The new float repr causes too much trouble and pain. I'm disabling the ↵Christian Heimes2007-12-111-1/+2
| | | | | | | feature until we have sorted out the issues on all machines. 64bit machines seem to have issues and Guido has reported even worse. Guido: It's pretty bad actually -- repr(1e5) comes out as '1.0'... Ditto for repr(1eN) for most N... Both in 2.6 and in 3.0...
* Backport of r59456:59458 from py3k to trunkChristian Heimes2007-12-101-1/+16
| | | | | | Issue #1580: New free format floating point representation based on "Floating-Point Printer Sample Code", by Robert G. Burger. For example repr(11./5) now returns '2.2' instead of '2.2000000000000002'. Thanks to noam for the patch! I had to modify doubledigits.c slightly to support X64 and IA64 machines on Windows. I also added the new file to the three project files.
* Fix compile.c so that it records 0.0 and -0.0 as separate constants in a codeAlex Martelli2007-08-221-0/+15
| | | | | object's co_consts tuple; add a test to show that the previous behavior (where these two constants were "collapsed" into one) causes serious malfunctioning.
* Reverting the patch that tried to fix the issue whereby x**2 raisesAlex Martelli2006-08-231-14/+1
| | | | | | | OverflowError while x*x succeeds and produces infinity; apparently these inconsistencies cannot be fixed across ``all'' platforms and there's a widespread feeling that therefore ``every'' platform should keep suffering forevermore. Ah well.
* x**2 should about equal x*x (including for a float x such that the result isAlex Martelli2006-08-231-1/+14
| | | | | | inf) but didn't; added a test to test_float to verify that, and ignored the ERANGE value for errno in the pow operation to make the new test pass (with help from Marilyn Davis at the Google Python Sprint -- thanks!).
* Whitespace normalization.Tim Peters2005-06-031-1/+1
|
* This is my patch:Michael W. Hudson2005-05-271-0/+110
[ 1181301 ] make float packing copy bytes when they can which hasn't been reviewed, despite numerous threats to check it in anyway if noone reviews it. Please read the diff on the checkin list, at least! The basic idea is to examine the bytes of some 'probe values' to see if the current platform is a IEEE 754-ish platform, and if so _PyFloat_{Pack,Unpack}{4,8} just copy bytes around. The rest is hair for testing, and tests.