quadratic-irrational: An implementation of quadratic irrationals
A quadratic irrational is a number that can be expressed in the form
(a + b √c) / d
d are integers and
c is a square-free natural number.
Some examples of such numbers are
(1 + √5)/2(the golden ratio),
solutions to quadratic equations with rational constants – the quadratic formula has a familiar shape.
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, …]
a is an integer and
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]
|Versions||0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5|
|Dependencies||arithmoi (==0.4.*), base (>=4.6 && <4.8), containers (==0.5.*), mtl (==2.1.*), transformers (==0.3.*) [details]|
|Copyright||Copyright © 2014 Johan Kiviniemi|
|Author||Johan Kiviniemi <email@example.com>|
|Maintainer||Johan Kiviniemi <firstname.lastname@example.org>|
|Category||Math, Algorithms, Data|
|Source repo||head: git clone https://github.com/ion1/quadratic-irrational.git|
|Uploaded||by ion at Fri Mar 28 21:58:19 UTC 2014|
|Downloads||1813 total (75 in the last 30 days)|
|Rating||(no votes yet) [estimated by rule of succession]|
|Status||Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI
For package maintainers and hackage trustees