Mark Dickinson
1abe6cd842
Issue #13889 : Add missing _Py_SET_53BIT_PRECISION_* calls around uses of dtoa.c functions in float round.
14 years ago
Mark Dickinson
874d59ee91
Issue #11144 : Fix corner cases where float-to-int conversion unnecessarily returned a long.
15 years ago
Mark Dickinson
ecf8ec67ce
Merged revisions 87032 via svnmerge from
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.
........
15 years ago
Benjamin Peterson
df1bc015f2
Merged revisions 82447 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82447 | benjamin.peterson | 2010-07-02 14:41:39 -0500 (Fri, 02 Jul 2010) | 1 line
add space
........
16 years ago
Benjamin Peterson
cf76d1f0c7
add space
16 years ago
Antoine Pitrou
c7c96a90bc
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
16 years ago
Antoine Pitrou
c83ea137d7
Untabify C files. Will watch buildbots.
16 years ago
Brett Cannon
a8ac944924
Add back in a line that was unneeded which advanced a pointer, but commented
out as it is currently unneeded.
This effectively adds back in the line removed in r80809 as a comment.
16 years ago
Brett Cannon
6f38175cbc
Remove an unneeded variable increment.
Found using Clang's static analyzer.
16 years ago
Ezio Melotti
bce3e17bd2
#7482 : clarify error message in case of division by zero of float and complex numbers.
16 years ago
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.
16 years ago
Mark Dickinson
31f0cfef0e
Include ieeefp.h (when available) in pyport.h instead of individually in
Objects/floatobject.c and Objects/complexobject.c. This should silence
compiler warnings about implicit declaration of the 'finite' function
on Solaris.
16 years ago
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.
16 years ago
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().
17 years ago
Eric Smith
cfaf79c56e
Start to remove _PyOS_double_to_string, as mentioned in issue 7117.
17 years ago
Eric Smith
8c3fb39440
Removed unused function PyFloat_AsStringEx. It is unused in floatobject.c, and it's not declared in any .h file.
17 years ago
Eric Smith
b327258d4f
Removed usage of unsafe PyFloat_AsString.
17 years ago
Benjamin Peterson
bf9ec9ba67
add underscores
17 years ago
Mark Dickinson
ce05717daa
Merged revisions 72564 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72564 | mark.dickinson | 2009-05-11 16:33:08 +0100 (Mon, 11 May 2009) | 2 lines
Issue #5981 : Fix some float.fromhex bugs related to inf and nan handling.
........
17 years ago
Mark Dickinson
b1d45856c2
Issue #5981 : Fix some float.fromhex bugs related to inf and nan handling.
17 years ago
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.
17 years ago
Mark Dickinson
777e4ff503
Eliminate some locale-dependent calls to isspace and tolower.
17 years ago
Mark Dickinson
df108ca324
Remove format_float and use _PyOS_double_to_string instead.
17 years ago
Mark Dickinson
6d6b220215
Backport r71967 changes from py3k to trunk.
(Internal plumbing changes for float parsing.)
17 years ago
Eric Smith
068f06568b
Issue #5835 , deprecate PyOS_ascii_formatd.
If anyone wants to clean up the documentation, feel free. It's my first documentation foray, and it's not that great.
Will port to py3k with a different strategy.
17 years ago
Benjamin Peterson
c843a4765a
Merged revisions 71627 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71627 | benjamin.peterson | 2009-04-15 16:26:36 -0500 (Wed, 15 Apr 2009) | 4 lines
call __float__ on str subclasses #5759
tests by R. David Murray
........
17 years ago
Benjamin Peterson
99d36f1563
call __float__ on str subclasses #5759
tests by R. David Murray
17 years ago
Benjamin Peterson
be2c0a9fe3
Merged revisions 66766-66767,66771-66772,66774,66776,66783-66787,66790,66793,66797 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
................
r66766 | benjamin.peterson | 2008-10-03 06:52:06 -0500 (Fri, 03 Oct 2008) | 1 line
update the mac installer script
................
r66767 | andrew.kuchling | 2008-10-03 07:26:42 -0500 (Fri, 03 Oct 2008) | 1 line
Docstring typo.
................
r66771 | hirokazu.yamamoto | 2008-10-03 11:18:42 -0500 (Fri, 03 Oct 2008) | 2 lines
Fixed following error when DocXMLRPCServer failed.
UnboundLocalError: local variable 'serv' referenced before assignment
................
r66772 | andrew.kuchling | 2008-10-03 11:29:19 -0500 (Fri, 03 Oct 2008) | 1 line
Mention exception in docstring
................
r66774 | andrew.kuchling | 2008-10-03 11:42:52 -0500 (Fri, 03 Oct 2008) | 1 line
Typo fix
................
r66776 | hirokazu.yamamoto | 2008-10-03 12:34:49 -0500 (Fri, 03 Oct 2008) | 2 lines
Issue #1706863 : Fixed "'NoneType' object has no attribute 'rfind'" error when sqlite libfile not found.
................
r66783 | andrew.kuchling | 2008-10-03 20:02:29 -0500 (Fri, 03 Oct 2008) | 1 line
Use correct capitalization of NaN
................
r66784 | andrew.kuchling | 2008-10-03 20:03:42 -0500 (Fri, 03 Oct 2008) | 1 line
Docstring change: Specify exception raised
................
r66785 | andrew.kuchling | 2008-10-03 20:04:24 -0500 (Fri, 03 Oct 2008) | 1 line
Docstring changes: Specify exceptions raised
................
r66786 | andrew.kuchling | 2008-10-03 20:05:56 -0500 (Fri, 03 Oct 2008) | 3 lines
Docstring change for *partition: use same tense as other docstrings.
Hyphenate left- and right-justified.
Fix 'registerd' typo
................
r66787 | andrew.kuchling | 2008-10-03 22:08:56 -0500 (Fri, 03 Oct 2008) | 1 line
two corrections
................
r66790 | andrew.kuchling | 2008-10-04 11:52:01 -0500 (Sat, 04 Oct 2008) | 1 line
Set svn:keywords
................
r66793 | georg.brandl | 2008-10-04 13:26:01 -0500 (Sat, 04 Oct 2008) | 2 lines
#4041 : don't refer to removed and outdated modules.
................
r66797 | benjamin.peterson | 2008-10-04 15:55:50 -0500 (Sat, 04 Oct 2008) | 19 lines
Merged revisions 66707,66775,66782 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r66707 | benjamin.peterson | 2008-09-30 18:27:10 -0500 (Tue, 30 Sep 2008) | 1 line
fix #4001 : fix_imports didn't check for __init__.py before converting to relative imports
........
r66775 | collin.winter | 2008-10-03 12:08:26 -0500 (Fri, 03 Oct 2008) | 4 lines
Add an alternative iterative pattern matching system that, while slower, correctly parses files that cause the faster recursive pattern matcher to fail with a recursion error. lib2to3 falls back to the iterative matcher if the recursive one fails.
Fixes http://bugs.python.org/issue2532 . Thanks to Nick Edds.
........
r66782 | benjamin.peterson | 2008-10-03 17:51:36 -0500 (Fri, 03 Oct 2008) | 1 line
add Victor Stinner's fixer for os.getcwdu -> os.getcwd #4023
........
................
18 years ago
Andrew M. Kuchling
bd7c4ca569
Use correct capitalization of NaN
18 years ago
Andrew MacIntyre
8c47cabbe9
should use macro'ed symbols not direct
Part of source_os2emx.patch in issue 3868
Reviewed by Amaury Forgeot d'Arc
18 years ago
Amaury Forgeot d'Arc
d3ffb8974f
#3777 : long(4.2) returned an int, and broke backward compatibility.
the __long__ slot is allowed to return either int or long, but the behaviour of
float objects should not change between 2.5 and 2.6.
Reviewed by Benjamin Peterson
18 years ago
Mark Dickinson
5c2bb1a7d4
issue 3633: Solaris allows fullwidth Unicode digits in isxdigit, so
rewrite float.fromhex to only allow ASCII hex digits on all platforms.
(Tests for this are already present, but the test_float failures
on Solaris hadn't been noticed before.)
Reviewed by Antoine Pitrou.
18 years ago
Mark Dickinson
7103aa42c0
Issue #3008 : add instance method float.hex and class method float.fromhex
to convert floats to and from hexadecimal strings respectively.
18 years ago
Gregory P. Smith
2fe77060eb
- Issue #2862 : Make int and float freelist management consistent with other
freelists. Changes their CompactFreeList apis into ClearFreeList apis and
calls them via gc.collect().
18 years ago
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.
18 years ago
Raymond Hettinger
9c437af4eb
Revert 64424, 64438, and 64439.
18 years ago
Hye-Shik Chang
30fa13f3a0
Fix build on FreeBSD gcc.
18 years ago
Raymond Hettinger
e0e711446b
Issue 3008: hex/oct/bin can show floats exactly.
18 years ago
Gregory P. Smith
dd96db63f6
This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
18 years ago
Eric Smith
dc13b79a38
Refactor and clean up str.format() code (and helpers) in advance of optimizations.
18 years ago
Christian Heimes
593daf545b
Renamed PyString to PyBytes
18 years ago
Mark Dickinson
e81c376080
Issue #2801 : fix bug in float.is_integer where ValueError
could be incorrectly raised. This is a backport of the
Py3k fix in r62939. (Should really have been fixed
in the trunk first and svnmerged into py3k.)
18 years ago
Christian Heimes
6f34109384
I finally got the time to update and merge Mark's and my trunk-math branch. 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 :)
18 years ago
Neal Norwitz
9fdfaaf9af
Fix compiler warning about finite() missing on Solaris.
18 years ago
Neal Norwitz
c0a56ff908
Pluralss only need one s, not 2 (intss -> ints)
18 years ago
Mark Dickinson
c23b8a7af9
Issue 705836: Fix struct.pack(">f", 1e40) to behave consistently
across platforms: it should now raise OverflowError on all
platforms. (Previously it raised OverflowError only on
non IEEE 754 platforms.)
Also fix the (already existing) test for this behaviour
so that it actually raises TestFailed instead of just
referencing it.
18 years ago
Eric Smith
a9f7d62480
Backport of PEP 3101, Advanced String Formatting, from py3k.
Highlights:
- Adding PyObject_Format.
- Adding string.Format class.
- Adding __format__ for str, unicode, int, long, float, datetime.
- Adding builtin format.
- Adding ''.format and u''.format.
- str/unicode fixups for formatters.
The files in Objects/stringlib that implement PEP 3101 (stringdefs.h,
unicodedefs.h, formatter.h, string_format.h) are identical in trunk
and py3k. Any changes from here on should be made to trunk, and
changes will propogate to py3k).
18 years ago
Christian Heimes
422051a367
Patch #1953
I implemented the function sys._compact_freelists() and C API functions PyInt_/PyFloat_CompactFreeList() to compact the pre-allocated blocks of ints and floats. They allow the user to reduce the memory usage of a Python process that deals with lots of numbers.
The patch also renames sys._cleartypecache to sys._clear_type_cache
18 years ago
Raymond Hettinger
2d1aa3350a
Simpler solution to handling non-IEEE 754 environments.
18 years ago
Raymond Hettinger
f9859037fc
Add protection from weirdness while scaling the mantissa to an integer.
18 years ago