Copyright | (c) Claude Heiland-Allen 2015 |
---|---|
License | BSD3 |
Maintainer | claude@mathr.co.uk |
Stability | unstable |
Portability | TypeFamilies |
Safe Haskell | Safe |
Language | Haskell98 |
Rational numbers with ruff-specific operations.
Documentation
Rational numbers with ruff-specific operations.
(%) :: Z r -> Z r -> r infixl 7 Source #
smart constuctor
numerator :: r -> Z r Source #
extract numerator
denominator :: r -> Z r Source #
extract denominator
(%!) :: Z r -> Z r -> r infixl 7 Source #
unsafe constructor
zero :: Integral (Z r) => r Source #
0
half :: Integral (Z r) => r Source #
1/2
one :: Integral (Z r) => r Source #
1
fromQ :: Integral (Z r) => r -> Rational Source #
convert to Prelude.Rational
toQ :: Integral (Z r) => Rational -> r Source #
convert from Prelude.Rational
wrap :: Integral (Z r) => r -> r Source #
wrap into [0,1)
doubleWrap :: Integral (Z r) => r -> r Source #
doubling map to [0,1)
double :: Integral (Z r) => r -> r Source #
doubling map from [0,1) to [0,1)
doubleOdd :: Integral (Z r) => r -> r Source #
doubling map from [0,1) to [0,1) for odd denominator
preimages :: Integral (Z r) => r -> (r, r) Source #
doubling map preimages from [0,1) to [0,1)x[0,1)
Ratio data structure
!a :% !a |