May 2019
Beginner
528 pages
29h 51m
English
Decimal for Monetary AmountsIn this section, we introduce Decimal capabilities for precise monetary calculations. If you enter banking or other fields that require the accuracy provided by type Decimal, you should investigate Decimal’s capabilities in depth.
For most scientific and other mathematical applications that use numbers with decimal points, Python’s built-in floating-point numbers work well. For example, when we speak of a “normal” body temperature of 98.6, we do not need to be precise to a large number of digits. When we view the temperature on a thermometer and read it as 98.6, the actual value may be 98.5999473210643. The point here is that calling this number 98.6 is adequate for most body-temperature applications. ...
Read now
Unlock full access