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/1999-December/001747.html below:

[Python-Dev] Fixed Decimal types

[Python-Dev] Fixed Decimal typesGordon McMillan gmcm@hypernet.com
Thu, 23 Dec 1999 15:48:56 -0500
Jim Fulton wrote:
> "Da Silva, Mike" wrote:

[AS400 RPG rules...]

> Yee ha! This is great input. Anyone have any other examples of
> what any other systems do? Anyone got a PL/I manual handy. ;)

From memory of IBM COBOL and SQL, the rules for 
intermediates seem similar to what Mike outlines. In both 
cases, the target is pre-specified, and I think by default you 
get auto-rounding.

Tim's BCD class seem to always return the higher precision 
on an arithmetic op, although the intermediate is full precision.
 
>> However, unlike RPG, we should probably ensure 
>> that attempts to overflow or underflow the scale 
>> result in NaN or Overflow conditions, rather
>> than assuming the user is right and losing 
>> the significant digits.
 
> Since this would be based on infinite-precision numbers, I don't
> think that this would be an issue.

It's an issue if the result of an arithmetic op is other than "full" 
precision. The issue certainly comes up when you e.g. talk to 
a DB, and it might be better to have it come up sooner rather 
than later.

- Gordon



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