Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Defines the classes of Pi-algorithm which have been implemented.
Type-classes
class Algorithmic algorithm where Source #
- Defines the methods expected of a Pi-algorithm.
- Most of the implementations naturally return a
Rational
, but the spigot-algorithms naturally produce a[Int]
; though representing Pi as a big integer with the decimal point removed is clearly incorrect. - Since representing Pi as either a
Rational
or promoted to anInteger
, is inconvenient, an alternative decimalString
-representation is provided.
openR :: algorithm -> DecimalDigits -> Rational Source #
openI :: algorithm -> DecimalDigits -> Integer Source #
openS :: algorithm -> DecimalDigits -> String Source #
Algorithmic Algorithm Source # | |
Algorithmic Algorithm Source # | |
Algorithmic squareRootAlgorithm => Algorithmic (Algorithm squareRootAlgorithm) Source # | |
(Algorithmic squareRootAlgorithm, Algorithmic factorialAlgorithm) => Algorithmic (Algorithm squareRootAlgorithm factorialAlgorithm) Source # | |
(Algorithmic squareRootAlgorithm, Algorithmic factorialAlgorithm) => Algorithmic (Algorithm squareRootAlgorithm factorialAlgorithm) Source # | |
(Algorithmic agm, Algorithmic bbp, Algorithmic borwein, Algorithmic ramanujan, Algorithmic spigot) => Algorithmic (Category agm bbp borwein ramanujan spigot) Source # | |
Types
Data-types
data Category agm bbp borwein ramanujan spigot Source #
Categorises the various algorithms.
AGM agm | Algorithms based on the Arithmetic-geometric Mean. |
BBP bbp | https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula. |
Borwein borwein | |
Ramanujan ramanujan | |
Spigot spigot | Algorithms from which the digits of Pi slowly drip, one by one. |
(Eq spigot, Eq ramanujan, Eq borwein, Eq bbp, Eq agm) => Eq (Category agm bbp borwein ramanujan spigot) Source # | |
(Read spigot, Read ramanujan, Read borwein, Read bbp, Read agm) => Read (Category agm bbp borwein ramanujan spigot) Source # | |
(Show spigot, Show ramanujan, Show borwein, Show bbp, Show agm) => Show (Category agm bbp borwein ramanujan spigot) Source # | |
Default bbp => Default (Category agm bbp borwein ramanujan spigot) Source # | |
(Algorithmic agm, Algorithmic bbp, Algorithmic borwein, Algorithmic ramanujan, Algorithmic spigot) => Algorithmic (Category agm bbp borwein ramanujan spigot) Source # | |