Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Defines the parameters of a series used in a Spigot-table to generate Pi.
- data Series i = MkSeries {
- coefficients :: [i]
- baseNumerators :: [i]
- baseDenominators :: [i]
- nTerms :: DecimalDigits -> Int
- bases :: Integral i => Series i -> [Ratio i]
Types
Data-types
- Defines a series composed from a sum of terms, each one of which is the product of a coefficient and a base.
- The coefficents and bases of the series are described in Horner form;
Pi = c1 + (b1 * (c2 + b2 * (c3 + b3 * (...))))
.
MkSeries | |
|
Functions
bases :: Integral i => Series i -> [Ratio i] Source #
Combines baseNumerators
and baseDenominators
, and as a side-effect, expresses the ratio in lowest terms.