@hackage fp-ieee0.1.0.2

IEEE 754-2019 compliant operations

  • Installation

  • Dependencies (6)

  • Dependents (1)

    @hackage/rounded-hw
  • Package Flags

      pure-hs
       (off by default)

      Disable FFI

      sse4_1
       (off by default)

      Use SSE4.1 instructions on x86

      fma3
       (off by default)

      Use FMA3 instructions on x86

      f16c
       (off by default)

      Use F16C instructions on x86

      float128
       (off by default)

      Support Float128 via float128 package

      half
       (off by default)

      Support Half (float16) via half package

      integer-gmp
       (on by default)

      Use integer-gmp package on GHC 8.x

      ghc-bignum
       (on by default)

      Use ghc-bignum package on GHC 9.x

fp-ieee: IEEE 754 operations for floating-point types

This library provides IEEE 754-compliant operations, including

  • fusedMultiplyAdd.
  • correctly-rounding versions of fromInteger.
  • realFloatToFrac, which correctly handles signed zeros, infinities, and NaNs (unlike realToFrac).

Some operations (e.g. fusedMultiplyAdd) can make use of the native instruction in the architecture.

For non-native targets, "Pure Haskell" mode is supported via a package flag.

Most operations require only RealFloat constraint, but RealFloatNaN is needed by some operations that access the sign and payload of NaNs.