number-0.1.1.0: A library for real numbers

Safe HaskellSafe
LanguageHaskell2010

Data.Number.Types

Description

Definition of the continued fraction type

Synopsis

Documentation

data Continued a Source

Continued fraction type

Represents a simple continued fraction of the form:

Supports Haskell arithmetic operators though the use of the operator function is to be preferred since provide shortcuts to calculations.

It can be an infinite sequence. Be careful with functions like show and precision: they may not terminate.

Cons operator

n :| x equivalent to n + 1/x

Negate operator

M x equivalent to -x

Constructors

M (Continued a)

Negative number

a :| (Continued a) infixr 5

Positive number

E

Zero

Instances

type Number = Continued Nat Source

Real numbers datatype (a continued fraction of naturals)