| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Objects/floatobject.c and Objects/complexobject.c. This should silence
compiler warnings about implicit declaration of the 'finite' function
on Solaris.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
floatobject.c. Also, remove limitation on length of unicode inputs to
float().
|
| | |
|
| |
|
|
| |
and it's not declared in any .h file.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
| |
(Internal plumbing changes for float parsing.)
|
| |
|
|
|
|
| |
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.
|
| |
|
|
| |
tests by R. David Murray
|
| | |
|
| |
|
|
|
| |
Part of source_os2emx.patch in issue 3868
Reviewed by Amaury Forgeot d'Arc
|
| |
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
to convert floats to and from hexadecimal strings respectively.
|
| |
|
|
|
| |
freelists. Changes their CompactFreeList apis into ClearFreeList apis and
calls them via gc.collect().
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
optimizations.
|
| | |
|
| |
|
|
|
|
| |
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.)
|
| |
|
|
|
|
| |
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 :)
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
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
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Py_Initialize() and Py_Finalize().
|
| | |
|
| |
|
|
|
|
|
| |
it's useful outside of rational numbers.
This is my first C code that had to do anything significant. Please be more
careful when looking over it.
|
| |
|
|
|
| |
and eliminate a compiler warning in floatobject.c. There might be
a better way to go about this, but it should be good enough for now.
|
| |
|
|
|
|
| |
sys.float_info to a structseq. It's
readonly and help(sys.float_info) explains the attributes nicely.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
round included:
* Revert round to its 2.6 behavior (half away from 0).
* Because round, floor, and ceil always return float again, it's no
longer necessary to have them delegate to __xxx___, so I've ripped
that out of their implementations and the Real ABC. This also helps
in implementing types that work in both 2.6 and 3.0: you return int
from the __xxx__ methods, and let it get enabled by the version
upgrade.
* Make pow(-1, .5) raise a ValueError again.
|
| |
|
|
|
|
|
| |
the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361,
r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new
documentation. The only significant difference is that round(x) returns a float
to preserve backward-compatibility. See http://bugs.python.org/issue1689.
|
| |
|
|
| |
Py_REFCNT. Macros for b/w compatibility are available.
|
| |
|
|
|
|
| |
platforms).
The patch unifies float("inf") and repr(float("inf")) on all platforms.
|
| |
|
|
|
|
|
| |
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...
|