number-0.1.0.0: A library for real numbers

Safe HaskellSafe
LanguageHaskell2010

Data.Number.Internal

Description

Data.Number internals

Synopsis

Documentation

type Matrix = (Whole, Whole, Whole, Whole, Whole, Whole, Whole, Whole) Source

Operator Matrix

operator :: Matrix -> Number -> Number -> Number Source

Continued fraction operator (implements Gosper's arithmetics)

Given two Number x, y and the operator matrix

calculates

See http://perl.plover.com/yak/cftalk/INFO/gosper.txt for a complete explanation.

cut :: Nat -> Number -> Number Source

Truncate a Number to a given length n

first :: Number -> Whole Source

Extract the first natural of the fraction as a Whole number

rest :: Number -> Number Source

Extract the "tail" of a Number as a new Number Equivalent to (x - floor x) for a floating point.

split :: Number -> (Whole, Number) Source

Split a Number into a Whole (the most significant of the fraction) and the rest of the Number. Equivalent to (floor x, x - floor x) for a floating point.