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-July/045907.html below:

[Python-Dev] decimal API

[Python-Dev] decimal APIRaymond Hettinger python at rcn.com
Tue Jul 6 06:55:25 CEST 2004
[Michael]
> Here are my thoughts, just as untutored as yours. I'm working
> primarily from hursley's spec here...

For the alpha, I've left all of the traps off except for
ConversionSyntax.  The reasoning that the numeric model is otherwise
self-contained.  Dividing by zero usefully gives Infinity.  NaNs result
from non-sensical operations.  NaNs can even have diagnositic
information associated with them.  Let's let people experience what the
standard has to offer.

By way of comparison, look at MS Excel.  Rather than bomb-out, it has
values such as N/A and #DIV/0 which are all part of the model and flow
through calculations if necessary.

Though decimals play nice with many other Python tools, we shouldn't
hide that the model is different and that many of those differences are
for the better:

- Calculations taking place within a user settable context
- Special values such as NaNs and Infinities
- Negative zero
- Signals can be ignored, inspected (flag), or raised (trapped)
- Notion of significance:   1.25 + 1.75 --> 3.00 with two trailing
zeroes



Raymond

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