qd: double-double and quad-double number type via libqd

[ bsd3, library, math ] [ Propose Tags ]

This package supports both a double-double datatype (approx. 32 decimal digits) and a quad-double datatype (approx. 64 decimal digits), using libqd (which is implemented in C++ with C and Fortran wrappers). To compile this package you need libqd to be installed.

Numeric.QD.DoubleDouble.DoubleDouble and Numeric.QD.QuadDouble.QuadDouble are strict tuples of CDoubles, with the following instances:

But note that the following functions (while present) are undefined:

Non-crashing implementations of these are planned in a future update to this package, as well as instances of Enum and Read.

Additional note: libqd depends on 64bit doubles, while some FPU architectures use 80bit. It is highly recommended to compile with -fno-excess-precision and set the FPU control words to avoid erroneous behaviour, perhaps by doing something like this at the start of your program:

import Foreign (nullPtr)
import GHC.Conc (forkOnIO, numCapabilities)
import Numeric.QD.FPU.Raw (fpu_fix_start)
main :: IO ()
main = do
  mapM_ (flip forkOnIO $ fpu_fix_start nullPtr) [ 0 .. numCapabilities - 1 ]
  -- ...
Versions 0.1, 0.2, 0.4, 0.4.1, 1.0,
Dependencies base (==4.*) [details]
License BSD-3-Clause
Author Claude Heiland-Allen
Maintainer claudiusmaximus@goto10.org
Category Math
Uploaded by ClaudeHeilandAllen at Wed Oct 20 19:54:25 UTC 2010
Distributions NixOS:
Downloads 2140 total (18 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees