summaryrefslogtreecommitdiff
path: root/Lib/test/test_float.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #11144: Fix corner cases where float-to-int conversion unnecessarily ↵Mark Dickinson2011-03-261-0/+42
| | | | returned a long.
* #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-2/+2
|
* Merged revisions 87032 via svnmerge fromMark Dickinson2010-12-041-0/+20
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87032 | mark.dickinson | 2010-12-04 12:25:30 +0000 (Sat, 04 Dec 2010) | 3 lines Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__ with respect to signed zeros. ........
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-8/+8
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* Merged revisions 86003 via svnmerge fromBrian Curtin2010-10-311-13/+14
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86003 | brian.curtin | 2010-10-30 19:03:45 -0500 (Sat, 30 Oct 2010) | 2 lines Fix ResourceWarning. Use context manager to properly close file. ........
* don't require the presence of __getformat__ or __setformat__; use ↵Benjamin Peterson2010-07-021-42/+49
| | | | requires_IEEE_754 globally
* Merge test_strtod and test_float string-to-float conversion tests.Mark Dickinson2010-06-201-102/+0
|
* Use a more robust infinity check in _Py_HashDouble.Mark Dickinson2010-04-051-0/+9
| | | | | This fixes a test_decimal failure on FreeBSD 8.0. (modf apparently doesn't follow C99 Annex F on FreeBSD.)
* Check that 'd' isn't allowed as an exponent specifier in inputs to the float ↵Mark Dickinson2010-02-121-0/+3
| | | | function.
* Remove unused imports in test modules.Georg Brandl2010-02-071-2/+0
|
* use assert[Not]In where appropriateEzio Melotti2010-01-231-4/+4
|
* Issue #7632: Fix a bug in dtoa.c that could lead to incorrectly-rounded ↵Mark Dickinson2010-01-121-0/+102
| | | | results.
* Backport some float repr tests that were missed in issue 7117.Mark Dickinson2010-01-081-0/+49
|
* Issue #7534: Fix handling of nans, infinities, and negative zero in **Mark Dickinson2009-12-301-0/+212
| | | | operator, on IEEE 754 platforms. Thanks Marcos Donolo for original patch.
* Issue #4482: Add tests for special float value formatting.Eric Smith2009-12-021-0/+35
|
* Issue #3382: Make '%F' and float.__format__('F') convert results to upper ↵Eric Smith2009-11-291-2/+12
| | | | case. Much of the patch came from Mark Dickinson.
* round(0, "ermintrude") succeeded instead of producing a TypeError. Fix this.Mark Dickinson2009-11-241-0/+5
|
* Issue #7117, continued: Change round implementation to use the ↵Mark Dickinson2009-11-181-1/+139
| | | | | | | | correctly-rounded string <-> float conversions; this makes sure that the result of the round operation is correctly rounded, and hence displays nicely using the new float repr.
* Test long inputs to floatMark Dickinson2009-10-271-0/+5
|
* Issue #7117: Use PyOS_string_to_double instead of PyOS_ascii_strtod inMark Dickinson2009-10-261-2/+0
| | | | | floatobject.c. Also, remove limitation on length of unicode inputs to float().
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-17/+17
|
* Issue #5981: Fix some float.fromhex bugs related to inf and nan handling.Mark Dickinson2009-05-111-0/+31
|
* Issue #5920: Changed format.__float__ and complex.__float__ to use a ↵Eric Smith2009-05-051-0/+47
| | | | precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson.
* Backport some of the float formatting tests from py3k.Mark Dickinson2009-04-291-0/+19
|
* Issue #5864: format(1234.5, '.4') gives misleading resultMark Dickinson2009-04-291-0/+5
| | | | (Backport of r72109 from py3k.)
* call __float__ on str subclasses #5759Benjamin Peterson2009-04-151-0/+12
| | | | tests by R. David Murray
* fix missing moduleBenjamin Peterson2008-09-061-1/+1
|
* #3796: A test class was not run in test_float.Amaury Forgeot d'Arc2008-09-061-1/+3
| | | | Reviewed by Benjamin.
* Fix float.fromhex test to give additional information on failure. ThisMark Dickinson2008-08-211-1/+7
| | | | | | change is aimed at diagnosing issue 3633 (test_float fails on Solaris). Reviewed by Benjamin Peterson
* 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.