factory-0.0.0.2: Rational arithmetic in an irrational world.

Factory.Math.Power

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Exports functions involving integral powers.

Synopsis

Functions

square :: Num n => n -> nSource

Mainly for convenience.

squaresFrom :: Num n => n -> [(n, n)]Source

  • Iteratively generate sequential squares, from the specified initial value, based on the fact that (x + 1)^2 = x^2 + 2 * x + 1.
  • The initial value doesn't need to be either positive or integral.

maybeSquareNumber :: Integral i => i -> Maybe iSource

cube :: Num n => n -> nSource

Just for convenience.

cubeRoot :: Double -> DoubleSource

Just for convenience.

raiseModuloSource

Arguments

:: (Integral i, Integral power) 
=> i

Base.

-> power 
-> i

Modulus.

-> i

Result.

Predicates

isPerfectPower :: Integral i => i -> BoolSource