finance/hs-Decimal 0.5.2nb11 NetBSD
Decimal arithmetic for financial applications
- System
- NetBSD
- Repository
- pkgsrc
- Maintainer
- [email protected]
- License
- modified-bsd
- Categories
- finance, math
- Package size
- 145.6 KiB, 1292.0 KiB installed
Description
Haskell-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.
Install
Binary package:
pkgin install hs-Decimal
From pkgsrc:
cd /usr/pkgsrc/finance/hs-Decimal && make install clean
Packages
The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.
| Repository | Version |
|---|---|
| NetBSD 10.1 x86_64 | 0.5.2nb11 |
| NetBSD 10.1 aarch64 | 0.5.2nb11 |
| SmartOS / illumos x86_64 | 0.5.2nb11 |
| macOS 15 arm64 | 0.5.2nb11 |