Author mark
Recipients christian.heimes, gvanrossum, mark
Date 2007-12-15.21:27:29
SpamBayes Score 0.00516826
Marked as misclassified No
Message-id <200712152124.31327.mark@qtrac.eu>
In-reply-to <1197753258.76.0.197473605841.issue1600@psf.upfronthosting.co.za>
Content
On 2007-12-15, Christian Heimes wrote:
> Christian Heimes added the comment:
>
> Guido is right. On Linux the system's sprintf() family prints %e, %g and
> %f with two or three digits while Windows always uses three digits:
>
> Linux
> >>> "%e" % 1e1
> '1.000000e+01'
> >>> "%e" % 1e10
> '1.000000e+10'
> >>> "%e" % 1e100
> '1.000000e+100'
>
> Windows
> >>> "%e" % 1e1
> '1.000000e+001'
> >>> "%e" % 1e10
> '1.000000e+010'
> >>> "%e" % 1e100
> '1.000000e+100'
>
> The output could be changed in any of the functions:
> Objects/floatobject.h:format_double()
> Python/pystrtod.c:PyOS_ascii_formatd()
> Python/mysnprint.c:PyOS_snprintf()

It seems to me that Python should provide consistent results across
platforms wherever possible and that this is a gratuitous inconsistency
that makes cross-platform testing less convenient than it need be.

I'll take a look at those functions next week.
History
Date User Action Args
2007-12-15 21:27:30marksetspambayes_score: 0.00516826 -> 0.00516826
recipients: + mark, gvanrossum, christian.heimes
2007-12-15 21:27:29marklinkissue1600 messages
2007-12-15 21:27:29markcreate