A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-February/033049.html below:

[Python-Dev] FixedPoint and % specifiers.

[Python-Dev] FixedPoint and % specifiers. [Python-Dev] FixedPoint and % specifiers.Tim Peters tim.one@comcast.net
Wed, 05 Feb 2003 20:13:40 -0500
[Guido]
> Eh?  In C as well as Python, %d means decimal *integer*.  The format
> specifier to use fixed point notation is %f.
>
> Please don't change this!

I sure wouldn't <wink>.  Note that use of %f ends up calling
FixedPoint.__float__(), though, and so sucks users right back into binary fp
surprises:

>>> t = FixedPoint.FixedPoint(".1")
>>> print t
0.10
>>> print "%.17f" % t
0.10000000000000001
>>> float(t) == 0.1
True
>>>

FixedPoint does the best possible job of converting 1/10 to a float, but
it's exactly as surprising as the float literal 0.1 then.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4