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/2004-April/044311.html below:

[Python-Dev] Decimal data type issues

[Python-Dev] Decimal data type issuesGreg Ewing greg at cosc.canterbury.ac.nz
Thu Apr 15 20:09:38 EDT 2004
Ka-Ping Yee <python-dev at zesty.ca>:

> The extra method should be specifically for the exceptional case,
> and named appropriately.
> 
>     Decimal.exact_float(value)

That's a confusing name, since it seems to be promising that the
conversion will be exact. While this might technically be true for
certain values of float, there's no way the implementation can know
whether the result is exactly what the user had in mind for the
meaning of that float.

I think the name from_float is fine, since it says "I know
constructing a Decimal from a float isn't necessarily exact, but I
want to do it anyway, and I'm prepared to accept the result,
whatever it is."

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev mailing list

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