euler-0.1.0.0

Safe HaskellSafe
LanguageHaskell2010

Euler.Util.Polynomial

Synopsis

Documentation

type Coefficients = [] Source #

Polynomials are represented by coefficient lists. For example, /7 + 5x - 4x^2 + 12x^4/ has coefficients [7, 5, -4, 0, 12].

eval :: Num a => Coefficients a -> a -> a Source #

eval cfs x is the value of the polynomial with coefficients cfs at point x

hasIntRootBetween :: Integral a => Coefficients a -> a -> a -> Bool Source #

hasIntRootBetween cfs a b tells whether there exists an integral root of the polynomial having coefficients cfs on the inclusive interval [a, b].

findIntRootBetween :: Integral a => Coefficients a -> a -> a -> Maybe a Source #

findIntRootBetween cfs a b is an integral root of the polynomial having coefficients cfs on the inclusive interval [a, b], if one exists.