summaryrefslogtreecommitdiff
path: root/Python/pystrtod.c
AgeCommit message (Collapse)AuthorLines
2009-10-31Deprecate PyOS_ascii_strtod and PyOS_ascii_atof, and document the ↵Mark Dickinson-2/+12
replacement function PyOS_string_to_double.
2009-10-26Finished removing _PyOS_double_to_string, as mentioned in issue 7117.Eric Smith-135/+0
2009-10-26Issue #7117 (backport py3k float repr) continued:Mark Dickinson-92/+698
Backport pystrtod.c from py3k.
2009-05-05Issue #5920: Changed format.__float__ and complex.__float__ to use a ↵Eric Smith-7/+6
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-03Don't use PyOS_strnicmp for NaN and Inf detection: it's locale-aware.Mark Dickinson-3/+16
2009-05-03Eliminate some locale-dependent calls to isspace and tolower.Mark Dickinson-1/+1
2009-04-29Remove format_float and use _PyOS_double_to_string instead.Mark Dickinson-0/+14
2009-04-29Issue #5864: format(1234.5, '.4') gives misleading resultMark Dickinson-11/+104
(Backport of r72109 from py3k.)
2009-04-28Silence warning on Windows.Eric Smith-1/+1
2009-04-27Issue #5793: rationalize isdigit / isalpha / tolower, etc. Will port to ↵Eric Smith-15/+9
py3k. Should fix Windows buildbot errors.
2009-04-26Fix typo in function nameMark Dickinson-3/+3
2009-04-26Backport r71967 changes from py3k to trunk.Mark Dickinson-30/+57
(Internal plumbing changes for float parsing.)
2009-04-25Issue #5835, deprecate PyOS_ascii_formatd.Eric Smith-45/+109
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.
2009-04-24Issue #5816:Mark Dickinson-2/+3
- simplify parsing and printing of complex numbers - make complex(repr(z)) round-tripping work for complex numbers involving nans, infs, or negative zeros - don't accept some of the stranger complex strings that were previously allowed---e.g., complex('1..1j')
2009-04-22Backport of some of the work in r71665 to trunk. This reworks much ofEric Smith-57/+130
int, long, and float __format__(), and it keeps their implementation in sync with py3k. Also added PyOS_double_to_string. This is the "fallback" version that's also available in trunk, and should be kept in sync with that code. I'll add an issue to document PyOS_double_to_string in the C API. There are many internal cleanups. Externally visible changes include: - Implement PEP 378, Format Specifier for Thousands Separator, for floats, ints, and longs. - Issue #5515: 'n' formatting for ints, longs, and floats handles leading zero formatting poorly. - Issue #5772: For float.__format__, don't add a trailing ".0" if we're using no type code and we have an exponent.
2008-07-19Fix issue 3411: default float format spec fails on negative numbers.Eric Smith-0/+4
2008-06-24Modified interface to _Py_[String|Unicode]InsertThousandsGrouping, in ↵Eric Smith-1/+1
anticipation of fixing issue 3140.
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-1/+1
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.
2008-05-26Renamed PyString to PyBytesChristian Heimes-1/+1
2008-05-11Addresses issue 2802: 'n' formatting for integers.Eric Smith-45/+4
Adds 'n' as a format specifier for integers, to mirror the same specifier which is already available for floats. 'n' is the same as 'd', but inserts the current locale-specific thousands grouping. I added this as a stringlib function, but it's only used by str type, not unicode. This is because of an implementation detail in unicode.format(), which does its own str->unicode conversion. But the unicode version will be needed in 3.0, and it may be needed by other code eventually in 2.6 (maybe decimal?), so I left it as a stringlib implementation. As long as the unicode version isn't instantiated, there's no overhead for this.
2008-04-30Issue 2526, float.__format__ 'n' specifier does not support thousands grouping.Eric Smith-128/+229
Implemented grouping, with tests. Cleaned up PyOS_ascii_formatd by breaking reformatting into smaller functions.
2008-03-17Reformated lines > 79 chars.Eric Smith-8/+12
Deleted unused macro ISXDIGIT.
2008-03-17Issue 2264: empty float presentation type needs to have at least one digit ↵Eric Smith-17/+61
past the decimal point. Added "Z" format_char to PyOS_ascii_formatd to support empty float presentation type. Renamed buf_size in PyOS_ascii_formatd to more accurately reflect it's meaning. Modified format.__float__ to use the new "Z" format as the default. Added test cases.
2008-02-20Trim leading zeros from a floating point exponent, per C99. See issue 1600. ↵Eric Smith-27/+127
As far as I know, this only affects Windows. Add float type 'n' to PyOS_ascii_formatd (see PEP 3101 for 'n' description).
2008-01-05Patch #1725 by Mark Dickinson, fixes incorrect conversion of -1e1000Guido van Rossum-22/+52
and adds errors for -0x.
2006-07-03Bug #1417699: Reject locale-specific decimal point in float()Martin v. Löwis-0/+7
and atof().
2006-05-29Fix compiler warning.Georg Brandl-1/+1
2006-05-29Handle PyMem_Malloc failure in pystrtod.c. Closes #1494671.Georg Brandl-0/+7
2006-05-25Swap out bare malloc()/free() use for PyMem_MALLOC()/PyMem_FREE() .Brett Cannon-2/+2
2006-04-11Some more changes to make code compile under a C++ compiler.Anthony Baxter-1/+1
2006-02-15Merge ssize_t branch.Martin v. Löwis-1/+1
2006-01-08Fix icc warnings: strlen() returns size_tNeal Norwitz-3/+2
2005-12-18Fix compiler warningsNeal Norwitz-2/+2
2005-12-18Get float() to be more portable across platforms. Disable hex strings.Neal Norwitz-48/+25
2004-06-08Patch #774665: Make Python LC_NUMERIC agnostic.Martin v. Löwis-0/+258