number-0.1.0.0: A library for real numbers
Data.Number.Internal
Description
Data.Number internals
Synopsis
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
Number
x
y
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
n
first :: Number -> Whole Source
Extract the first natural of the fraction as a Whole number
Whole
rest :: Number -> Number Source
Extract the "tail" of a Number as a new Number Equivalent to (x - floor x) for a floating point.
(x - floor x)
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.
(floor x, x - floor x)