Mantissa-0.1.0.0: Reals in the interval [0,1), as machine words
Safe HaskellSafe-Inferred
LanguageHaskell2010

Numeric.Mantissa.Unboxed

Description

Real numbers in [0,1), represented as fixed-point reals stored in a machine word.

Fractional would arguably be a better name, but is of course already in use.

Synopsis

Documentation

newtype Mantissa# Source #

A real number in [0,1), represented as an unboxed word

Constructors

Mantissa# Word# 

plusWithOverflowMantissa# :: Mantissa# -> Mantissa# -> (# Mantissa#, Int# #) Source #

The second Int# component is nonzero on overflow

minusWithOverflowMantissa# :: Mantissa# -> Mantissa# -> (# Mantissa#, Int# #) Source #

The second Int# component is nonzero on overflow

quotMantissa# :: Mantissa# -> Mantissa# -> Mantissa# Source #

The user is responsible for ensuring that, when they take dividend/divisor, then the dividend is less than the divisor.