The quadratic-irrational package

[Tags:library, mit]

A library for exact computation with quadratic irrationals with support for exact conversion from and to (potentially periodic) simple continued fractions.

A quadratic irrational is a number that can be expressed in the form

 (a + b √c) / d

where a, b and d are integers and c is a square-free natural number.

Some examples of such numbers are

A simple continued fraction is a number expressed in the form

 a + 1/(b + 1/(c + 1/(d + 1/(e + …))))

or alternatively written as

 [a; b, c, d, e, …]

where a is an integer and b, c, d, e, … are positive integers.

Every finite SCF represents a rational number and every infinite, periodic SCF represents a quadratic irrational.

 3.5      = [3; 2]
 (1+√5)/2 = [1; 1, 1, 1, …]
 √2       = [1; 2, 2, 2, …]

[Skip to Readme]

Properties

Versions 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5
Change log ChangeLog.md
Dependencies arithmoi (==0.4.*), base (>=4.6 && <4.8), containers (==0.5.*), mtl (==2.1.*), transformers (==0.3.*) [details]
License MIT
Copyright Copyright © 2014 Johan Kiviniemi
Author Johan Kiviniemi <devel@johan.kiviniemi.name>
Maintainer Johan Kiviniemi <devel@johan.kiviniemi.name>
Stability provisional
Category Math, Algorithms, Data
Home page https://github.com/ion1/quadratic-irrational
Bug tracker https://github.com/ion1/quadratic-irrational/issues
Source repository head: git clone https://github.com/ion1/quadratic-irrational.git
Uploaded Fri Mar 28 21:58:19 UTC 2014 by ion
Distributions
Downloads 877 total (14 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for quadratic-irrational

Readme for quadratic-irrational-0.0.5

quadratic-irrational

Build Status

A library for exact computation with quadratic irrationals with support for exact conversion from and to (potentially periodic) simple continued fractions.

A quadratic irrational is a number that can be expressed in the form

(a + b √c) / d

where a, b and d are integers and c is a square-free natural number.

Some examples of such numbers are

A simple continued fraction is a number in the form

a + 1/(b + 1/(c + 1/(d + 1/(e + …))))

or alternatively written as

[a; b, c, d, e, …]

where a is an integer and b, c, d, e, … are positive integers.

Every finite SCF represents a rational number and every infinite, periodic SCF represents a quadratic irrational.

3.5      = [3; 2]
(1+√5)/2 = [1; 1, 1, 1, …]
√2       = [1; 2, 2, 2, …]