New submission from Cournapeau David <[email protected]>:
On windows, with python 2.6, s = '%s' % float('inf') is 'inf', but s =
'%f' % float('inf') is equal to '1.#INF'.
This patch fixes the inconsistency, by using the code from floatobject.f
format_float into stringobject.c formatfloat. I think it would be better
to use the same underlying implementations for both functions, but it is
not so easy, because format_float cannot fail (return void), whereas
formatfloat can (return error code).
----------
components: Interpreter Core
files: nan.patch
keywords: patch
messages: 78693
nosy: cdavid
severity: normal
status: open
title: handling inf/nan in '%f'
versions: Python 2.6
Added file: http://bugs.python.org/file12518/nan.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue4799>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com