Path to this page:
./
finance/hs-Decimal,
Decimal arithmetic for financial applications
Branch: CURRENT,
Version: 0.5.2nb8,
Package name: hs-Decimal-0.5.2nb8,
Maintainer: pkgsrc-usersHaskell-Decimal
===============
Fixed-precision decimal numbers, where the precision is carried with
the numbers at run-time.
The `Decimal` type is mainly intended for doing financial arithmetic
where the number of decimal places may not be known at compile time
(e.g. for a program that handles both Yen and Dollars) and the
application must not drop pennies on the floor. For instance if you
have to divide $10 between three people then one of them has to get
$3.34.
The number of decimal places in a value is represented as a Word8,
allowing for up to 255 decimal places. Functions preserve precision.
Addition and subtraction operators return a result with the precision
of the most precise argument, so 2.3 + 5.678 = 7.978. Multiplication
and division use whatever precision is necessary up to 255 decimal
places.
Required to run:[
lang/ghc88]
Required to build:[
pkgtools/cwrappers]
Master sites:
Filesize: 9.322 KB
Version history: (Expand)
- (2024-05-09) Updated to version: hs-Decimal-0.5.2nb8
- (2023-11-02) Updated to version: hs-Decimal-0.5.2nb7
- (2023-10-09) Updated to version: hs-Decimal-0.5.2nb6
- (2023-02-09) Updated to version: hs-Decimal-0.5.2nb5
- (2022-02-26) Updated to version: hs-Decimal-0.5.2nb4
- (2022-02-12) Updated to version: hs-Decimal-0.5.2nb3
CVS history: (Expand)