MyNixOS website logo
Description

Tests for deka, decimal floating point arithmetic.

deka provides decimal floating point arithmetic. It is based on mpdecimal, the C library used to provide support for the Decimal module in Python 3.

You will need to install mpdecimal to use deka; otherwise your executables will not link. It is available at

http://www.bytereef.org/mpdecimal/

mpdecimal has also been packaged for some Linux distributions, such as Debian (libmpdec-dev - available in Jessie and later) and Arch (mpdecimal).

mpdecimal, 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

This package contains only tests, so that other packages may also use the tests.

deka

deka provides correctly rounded decimal arithmetic for Haskell.

The core of deka is a binding to the C library mpdecimal. You need to install mpdecimal; otherwise, your executables will not link. mpdecimal is available here:

http://www.bytereef.org/mpdecimal/index.html

mpdecimal has also been packaged for some Linux distributions, such as Debian (libmpdec-dev) and Arch (mpdecimal). deka has been tested with mpdecimal version 2.4.0.

As the author of deka, I have no association with the author of mpdecimal, and any errors in this library are mine and should be reported to [email protected] or to the Github tracker at

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

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

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

and more about decimal arithmetic generally at

http://speleotrove.com/decimal/

Dependencies

The main deka library depends only on base, bytestring, and parsec, so it shouldn't be difficult to build. The tests use tasty and QuickCheck.

Test status

deka is tested using the tests available on the General Decimal Arithmetic website:

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

Some of these tests currently fail. The failures are in edge cases that should not affect most usage. Diagnosing these failures is on the TODO list.

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.

Metadata

Version

0.6.0.2

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows