deka: Decimal floating point arithmetic

[ bsd3, library, math ] [ Propose Tags ]

deka provides decimal floating point arithmetic. It is based on the decNumber C library, which is available at

http://speleotrove.com/decimal/decnumber.html

decNumber, in turn, implements the General Decimal Arithmetic Specification, which is available at

http://speleotrove.com/decimal/

For more on deka, please see the Github home page at

https://github.com/massysett/deka


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0.0, 0.2.0.2, 0.4.0.0, 0.4.0.2, 0.4.0.4, 0.6.0.0, 0.6.0.2
Change log ChangeLog
Dependencies base (>=4.5.0.0 && <4.8), bytestring (>=0.9.2.1 && <0.11) [details]
License BSD-3-Clause
Copyright 2014 Omari Norman
Author Omari Norman
Maintainer omari@smileystation.com
Category Math
Home page http://www.github.com/massysett/deka
Uploaded by OmariNorman at 2014-04-17T19:57:13Z
Distributions
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 5486 total (17 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Successful builds reported [all 1 reports]

Readme for deka-0.4.0.4

[back to package description]

deka

deka provides correctly rounded decimal arithmetic for Haskell.

The core of deka is a binding to the C library decNumber. As the author of deka, I have no association with the author of decNumber, and any errors in this library are mine and should be reported to omari@smileystation.com or to the Github tracker at

http://www.github.com/massysett/deka

deka uses the decQuad functions in decNumber. This means that deka is limited to 34 digits of precision. Because 1 quadrillion (that is, one thousand trillion) has only 16 digits of precision, I figure that 34 should be sufficient for many uses. Also, you are limited to exponents no smaller than -6176 and no greater than 6111. deka will notify you if you perform calculations that must be rounded in order to fit within the 34 digits of precision or within the size limits for the exponent.

You will want to understand decNumber and the General Decimal Arithmetic Specification in order to fully understand deka. The specification is at

http://speleotrove.com/decimal/decarith.html

and decNumber is at

http://speleotrove.com/decimal/decnumber.html

and more about decimal arithmetic generally at

http://speleotrove.com/decimal/

Dependencies

The main deka library depends only on base and bytestring, so it shouldn't be difficult to build. The tests use tasty and QuickCheck. The decNumber C library is bundled in; GHC will build it and link it for you when you install deka.

More documentation

Much more documentation is available in the Haddock comments in the source files. There is also a file of examples to get you started. It has copious comments. It is written in literate Haskell, so the compiler keeps me honest with the example code. Unfortunately Haddock does not play very nice with literate Haskell. However, the file is easy to view on Github:

Examples

License

deka is licensed under the BSD license, see the LICENSE file.

Build status

Build Status