factory-0.2.1.0: Rational arithmetic in an irrational world.

Safe HaskellSafe-Inferred

Factory.Math.Radix

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Facilitates representation of Integral values in alternative Integral bases.

Synopsis

Constants

Functions

digitSum :: (Ix decimal, Integral base, Integral decimal, Show base, Show decimal) => base -> decimal -> decimalSource

digitalRoot :: (Ix decimal, Integral decimal, Show decimal) => decimal -> decimalSource

fromBase :: (Integral base, Integral decimal, Read decimal, Show base) => base -> String -> decimalSource

  • Convert the String-representation of a number in the specified base, to a decimal integer.
  • Both negative numbers and negative bases are permissible.

toBase :: (Ix decimal, Integral base, Integral decimal, Show base, Show decimal) => base -> decimal -> StringSource

  • Convert the specified integral decimal quantity, to an alternative base, and represent the result as a String.
  • Both negative decimals and negative bases are permissible.
  • The conversion to Char can only succeed where printable and intelligible characters exist to represent all digits in the chosen base; which in practice means (-36 <= base <= 36).