Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fixed Precision Arithmetic
Haskell
Branch: master

README

latest commit c33097f614
@ekmett authored

README.markdown

fixed-precision

Provides a light-weight interface to Ales Bisjak's hmpfr bindings to MPFR for Haskell.

Phantom types carry the information about the precision and rounding mode.

Usage

Use a 53 bit mantissa (the same size as used by a Double), and round down intermediate results:

sin pi :: Fixed Down Double

Use a 256 bit mantissa, and round intermediate results to the nearest value:

pi :: Fixed Near $(bits 256)

Specify a mantissa size at runtime:

reifyPrecision 512 (\(p::p) -> show (logBase 10 2 :: Fixed Near p)) 

Contact Information

Please, feel free to contact me with questions, concerns, or bug fixes.

I can be reached as ekmett via github or as edwardk on the #haskell IRC channel on irc.freenode.net.

-Edward Kmett

Something went wrong with that request. Please try again.