Commit Graph

35 Commits

Author SHA1 Message Date
Mark Dickinson
876473bcc8 Check that 'd' isn't allowed as an exponent specifier in inputs to the float function. 2010-02-12 21:16:38 +00:00
Georg Brandl
a4f46e1292 Remove unused imports in test modules. 2010-02-07 17:03:15 +00:00
Ezio Melotti
aa98058cc4 use assert[Not]In where appropriate 2010-01-23 23:04:36 +00:00
Mark Dickinson
5ff4f279e6 Issue #7632: Fix a bug in dtoa.c that could lead to incorrectly-rounded results. 2010-01-12 22:55:51 +00:00
Mark Dickinson
3194d1454c Backport some float repr tests that were missed in issue 7117. 2010-01-08 16:53:56 +00:00
Mark Dickinson
99d652ef66 Issue #7534: Fix handling of nans, infinities, and negative zero in **
operator, on IEEE 754 platforms.  Thanks Marcos Donolo for original patch.
2009-12-30 12:12:23 +00:00
Eric Smith
f2bf0d2a51 Issue #4482: Add tests for special float value formatting. 2009-12-02 17:43:06 +00:00
Eric Smith
c4ab8339e9 Issue #3382: Make '%F' and float.__format__('F') convert results to upper case. Much of the patch came from Mark Dickinson. 2009-11-29 17:40:57 +00:00
Mark Dickinson
bce783757f round(0, "ermintrude") succeeded instead of producing a TypeError. Fix this. 2009-11-24 10:54:58 +00:00
Mark Dickinson
bd15a06fd3 Issue #7117, continued: Change round implementation to use the 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.
2009-11-18 19:33:35 +00:00
Mark Dickinson
53e9fa4eed Test long inputs to float 2009-10-27 22:09:33 +00:00
Mark Dickinson
8568b19850 Issue #7117: Use PyOS_string_to_double instead of PyOS_ascii_strtod in
floatobject.c.  Also, remove limitation on length of unicode inputs to
float().
2009-10-26 21:11:20 +00:00
Benjamin Peterson
5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Mark Dickinson
b1d45856c2 Issue #5981: Fix some float.fromhex bugs related to inf and nan handling. 2009-05-11 15:33:08 +00:00
Eric Smith
a985a3aee4 Issue #5920: Changed format.__float__ and complex.__float__ to use a 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. 2009-05-05 18:26:08 +00:00
Mark Dickinson
61a0d05291 Backport some of the float formatting tests from py3k. 2009-04-29 21:57:15 +00:00
Mark Dickinson
92fcc9c991 Issue #5864: format(1234.5, '.4') gives misleading result
(Backport of r72109 from py3k.)
2009-04-29 20:41:00 +00:00
Benjamin Peterson
99d36f1563 call __float__ on str subclasses #5759
tests by R. David Murray
2009-04-15 21:26:36 +00:00
Benjamin Peterson
a853a89dc3 fix missing module 2008-09-06 23:19:15 +00:00
Amaury Forgeot d'Arc
feb8cade4d #3796: A test class was not run in test_float.
Reviewed by Benjamin.
2008-09-06 20:53:51 +00:00
Mark Dickinson
892429b08b Fix float.fromhex test to give additional information on failure. This
change is aimed at diagnosing issue 3633 (test_float fails on Solaris).

Reviewed by Benjamin Peterson
2008-08-21 20:02:24 +00:00
Mark Dickinson
62764566e8 Fix float.from_hex tests. It appears that Linux/ia64 doesn't like
computing 2.0**-1074 accurately.  Using ldexp(1.0, -1074) should be
safer.
2008-07-15 21:55:23 +00:00
Mark Dickinson
7103aa42c0 Issue #3008: add instance method float.hex and class method float.fromhex
to convert floats to and from hexadecimal strings respectively.
2008-07-15 19:08:33 +00:00
Mark Dickinson
bf9f4d8015 Issue 3188: accept float('infinity') as well as float('inf'). This
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.
2008-07-05 11:33:52 +00:00
Benjamin Peterson
979395b7a8 Moved testing of builtin types out of test_builtin and into type specific modules 2008-05-03 21:35:18 +00:00