canon-0.1.1.0: Massive Number Arithmetic

Copyright(c) 2015-2019 Frederick Schneider
LicenseMIT
MaintainerFrederick Schneider <fws.nyc@gmail.com>
StabilityProvisional
Safe HaskellNone
LanguageHaskell2010

Math.NumberTheory.Canon.Simple

Description

This a wrapper for the Canonical Representation type found in the Internals module. If you want to work with arbitrarily nested prime towers, you can use the Math.NumberTheory.Canon module.

Synopsis

Documentation

newtype SimpleCanon Source #

SimpleCanon is a new type wrapping a canonical representation.

Constructors

MakeSC CR_ 
Instances
Enum SimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Eq SimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Fractional SimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Integral SimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Num SimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Ord SimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Real SimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Show SimpleCanon Source #

Define various instances

Instance details

Defined in Math.NumberTheory.Canon.Simple

CanonConv SimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

type SC = SimpleCanon Source #

Shorthand type declaration

toSimpleCanon :: CanonConv a => a -> SimpleCanon Source #

Convert CanonConv types to SimpleCanon.

toSC :: CanonConv c => c -> SimpleCanon Source #

Convert a type to a SimpleCanon.

toSimpleCanonViaUserFunc :: CR_ -> (Integer -> Bool) -> SimpleCanon Source #

This function allow you to specify a user function when converting a canon rep to an SC.

fromSimpleCanon :: SimpleCanon -> CR_ Source #

Grab the canon rep from a SimpleCanon.

fromSC :: SimpleCanon -> CR_ Source #

Grab the canon rep from a SimpleCanon.

class CanonConv c Source #

Typeclass for converting to SimpleCanon and RationalSimpleCanon

Minimal complete definition

toSC, toRC

scGCD :: SimpleCanon -> SimpleCanon -> SimpleCanon Source #

SimpleCanon GCD and LCM functions

scLCM :: SimpleCanon -> SimpleCanon -> SimpleCanon Source #

SimpleCanon GCD and LCM functions

scLog :: SimpleCanon -> Rational Source #

Wrapper for underlying CR function

scLogDouble :: SimpleCanon -> Double Source #

Wrapper for underlying CR function

scNegative :: SimpleCanon -> Bool Source #

Wrappers for underlying canon rep functions

scPositive :: SimpleCanon -> Bool Source #

Wrappers for underlying canon rep functions

scToInteger :: SimpleCanon -> Integer Source #

Convert a SimpleCanon back to an Integer.

scToI :: SimpleCanon -> Integer Source #

Convert a SimpleCanon back to an Integer.

newtype RationalSimpleCanon Source #

Newtype for RationalSimpleCanon. The underlying canon rep is the same.

Constructors

MakeRC CR_ 
Instances
Enum RationalSimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Eq RationalSimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Fractional RationalSimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Integral RationalSimpleCanon Source #

Caveat: These functions will error out (in)directly if there are any negative exponents.

Instance details

Defined in Math.NumberTheory.Canon.Simple

Num RationalSimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Ord RationalSimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Real RationalSimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

Show RationalSimpleCanon Source #

Define various instances for RationSimpleCanon.

Instance details

Defined in Math.NumberTheory.Canon.Simple

CanonConv RationalSimpleCanon Source # 
Instance details

Defined in Math.NumberTheory.Canon.Simple

type RC = RationalSimpleCanon Source #

Shorthand type name

toRationalSimpleCanon :: CanonConv a => a -> RationalSimpleCanon Source #

Convert CanonConv types to RationalSimpleCanon.

toRC :: CanonConv c => c -> RationalSimpleCanon Source #

Convert a type to a RationalSimpleCanon.

toRationalSimpleCanonViaUserFunc :: CR_ -> (Integer -> Bool) -> RationalSimpleCanon Source #

Convert canon rep to RationalSimpleCanon via a user-supplied criterion function.

fromRationalSimpleCanon :: RationalSimpleCanon -> CR_ Source #

Convert RC back to underlying canon rep.

fromRC :: RationalSimpleCanon -> CR_ Source #

Convert RC back to underlying canon rep.

rcNegative :: RationalSimpleCanon -> Bool Source #

Wraps underlying canon rep functions.

rcPositive :: RationalSimpleCanon -> Bool Source #

Wraps underlying canon rep functions.

getNumer :: RationalSimpleCanon -> SimpleCanon Source #

Pulls numerator or denominator from RC and converts it to a SimpleCanon.

getDenom :: RationalSimpleCanon -> SimpleCanon Source #

Pulls numerator or denominator from RC and converts it to a SimpleCanon.

getNumerDenom :: RationalSimpleCanon -> (SimpleCanon, SimpleCanon) Source #

Wraps crSplit function and returns a pair of SimpleCanons.

getNumerAsRC :: RationalSimpleCanon -> RationalSimpleCanon Source #

Calls underlying canon rep function.

getDenomAsRC :: RationalSimpleCanon -> RationalSimpleCanon Source #

Calls underlying canon rep function.

getNumerDenomAsRCs :: RationalSimpleCanon -> (RationalSimpleCanon, RationalSimpleCanon) Source #

Wraps crSplit function and returns a pair of RationalSimpleCanons.

rcLog :: RationalSimpleCanon -> Rational Source #

Calls underlying canon rep function.

rcLogDouble :: RationalSimpleCanon -> Double Source #

Calls underlying canon rep function.

(>^) :: SimpleCanonRoot a b c => a -> b -> c infixr 9 Source #

Root Operator

(<^) :: SimpleCanonExpnt a b c => a -> b -> c infixr 9 Source #

Exponentiation Operator

(%) :: Integral a => a -> a -> a infixl 7 Source #

Modulus operator