# IntegerNumberSystem¶

An IntegerNumberSystem is a model for the integers.

0: %

from AbelianMonoid

1: %

from MagmaWithUnit

*: (%, %) -> %

from LeftModule %

*: (Integer, %) -> %

from AbelianGroup

*: (NonNegativeInteger, %) -> %

from AbelianMonoid

*: (PositiveInteger, %) -> %

from AbelianSemiGroup

+: (%, %) -> %

from AbelianSemiGroup

-: % -> %

from AbelianGroup

-: (%, %) -> %

from AbelianGroup

<=: (%, %) -> Boolean

from PartialOrder

<: (%, %) -> Boolean

from PartialOrder

=: (%, %) -> Boolean

from BasicType

>=: (%, %) -> Boolean

from PartialOrder

>: (%, %) -> Boolean

from PartialOrder

^: (%, NonNegativeInteger) -> %

from MagmaWithUnit

^: (%, PositiveInteger) -> %

from Magma

~=: (%, %) -> Boolean

from BasicType

abs: % -> %

from OrderedRing

addmod: (%, %, %) -> %

addmod(a, b, p), 0<=a, b<p>1, means a+b mod p.

annihilate?: (%, %) -> Boolean

from Rng

antiCommutator: (%, %) -> %
associates?: (%, %) -> Boolean

from EntireRing

associator: (%, %, %) -> %
base: () -> %

base() returns the base for the operations of IntegerNumberSystem.

binomial: (%, %) -> %
bit?: (%, %) -> Boolean

bit?(n, i) returns true if and only if i-th bit of n is a 1.

characteristic: () -> NonNegativeInteger
coerce: % -> %

from Algebra %

coerce: % -> OutputForm
coerce: Integer -> %
commutator: (%, %) -> %
convert: % -> DoubleFloat
convert: % -> Float
convert: % -> InputForm
convert: % -> Integer
convert: % -> Pattern Integer
copy: % -> %

copy(n) gives a copy of n.

D: % -> %

from DifferentialRing

D: (%, NonNegativeInteger) -> %

from DifferentialRing

dec: % -> %

dec(x) returns x - 1.

differentiate: % -> %

from DifferentialRing

differentiate: (%, NonNegativeInteger) -> %

from DifferentialRing

divide: (%, %) -> Record(quotient: %, remainder: %)

from EuclideanDomain

euclideanSize: % -> NonNegativeInteger

from EuclideanDomain

even?: % -> Boolean

even?(n) returns true if and only if n is even.

expressIdealMember: (List %, %) -> Union(List %, failed)
exquo: (%, %) -> Union(%, failed)

from EntireRing

extendedEuclidean: (%, %) -> Record(coef1: %, coef2: %, generator: %)

from EuclideanDomain

extendedEuclidean: (%, %, %) -> Union(Record(coef1: %, coef2: %), failed)

from EuclideanDomain

factor: % -> Factored %
factorial: % -> %
gcd: (%, %) -> %

from GcdDomain

gcd: List % -> %

from GcdDomain

gcdPolynomial: (SparseUnivariatePolynomial %, SparseUnivariatePolynomial %) -> SparseUnivariatePolynomial %

from GcdDomain

hash: % -> SingleInteger

from SetCategory

hashUpdate!: (HashState, %) -> HashState

from SetCategory

inc: % -> %

inc(x) returns x + 1.

init: %

from StepThrough

invmod: (%, %) -> %

invmod(a, b), 0<=a<b>1, (a, b)=1 means 1/a mod b.

latex: % -> String

from SetCategory

lcm: (%, %) -> %

from GcdDomain

lcm: List % -> %

from GcdDomain

lcmCoef: (%, %) -> Record(llcm_res: %, coeff1: %, coeff2: %)

from LeftOreRing

leftPower: (%, NonNegativeInteger) -> %

from MagmaWithUnit

leftPower: (%, PositiveInteger) -> %

from Magma

leftRecip: % -> Union(%, failed)

from MagmaWithUnit

length: % -> %

length(a) length of a in digits.

mask(n) returns 2^n-1 (an n bit mask).

max: (%, %) -> %

from OrderedSet

min: (%, %) -> %

from OrderedSet

mulmod: (%, %, %) -> %

mulmod(a, b, p), 0<=a, b<p>1, means a*b mod p.

multiEuclidean: (List %, %) -> Union(List %, failed)

from EuclideanDomain

negative?: % -> Boolean

from OrderedRing

nextItem: % -> Union(%, failed)

from StepThrough

odd?: % -> Boolean

odd?(n) returns true if and only if n is odd.

one?: % -> Boolean

from MagmaWithUnit

opposite?: (%, %) -> Boolean

from AbelianMonoid

patternMatch: (%, Pattern Integer, PatternMatchResult(Integer, %)) -> PatternMatchResult(Integer, %)
permutation: (%, %) -> %
positive?: % -> Boolean

from OrderedRing

positiveRemainder: (%, %) -> %

positiveRemainder(a, b) (where b > 1) yields r where 0 <= r < b and r = a rem b.

powmod: (%, %, %) -> %

powmod(a, b, p), 0<=a, b<p>1, means a^b mod p.

prime?: % -> Boolean
principalIdeal: List % -> Record(coef: List %, generator: %)
quo: (%, %) -> %

from EuclideanDomain

random: % -> %

random(n) creates a random element from 0 to n-1.

rational?: % -> Boolean

rational?(n) tests if n is a rational number (see Fraction Integer).

rational: % -> Fraction Integer

rational(n) creates a rational number (see Fraction Integer).

rationalIfCan: % -> Union(Fraction Integer, failed)

rationalIfCan(n) creates a rational number, or returns “failed” if this is not possible.

recip: % -> Union(%, failed)

from MagmaWithUnit

rem: (%, %) -> %

from EuclideanDomain

retract: % -> Integer
retractIfCan: % -> Union(Integer, failed)
rightPower: (%, NonNegativeInteger) -> %

from MagmaWithUnit

rightPower: (%, PositiveInteger) -> %

from Magma

rightRecip: % -> Union(%, failed)

from MagmaWithUnit

sample: %

from AbelianMonoid

shift: (%, %) -> %

shift(a, i) shift a by i digits.

sign: % -> Integer

from OrderedRing

sizeLess?: (%, %) -> Boolean

from EuclideanDomain

smaller?: (%, %) -> Boolean

from Comparable

squareFree: % -> Factored %
squareFreePart: % -> %
submod: (%, %, %) -> %

submod(a, b, p), 0<=a, b<p>1, means a-b mod p.

subtractIfCan: (%, %) -> Union(%, failed)
symmetricRemainder: (%, %) -> %

symmetricRemainder(a, b) (where b > 1) yields r where -b/2 <= r < b/2.

unit?: % -> Boolean

from EntireRing

unitCanonical: % -> %

from EntireRing

unitNormal: % -> Record(unit: %, canonical: %, associate: %)

from EntireRing

zero?: % -> Boolean

from AbelianMonoid

AbelianGroup

AbelianMonoid

AbelianSemiGroup

BasicType

BiModule(%, %)

CancellationAbelianMonoid

canonicalUnitNormal

CharacteristicZero

CombinatorialFunctionCategory

CommutativeRing

CommutativeStar

Comparable

DifferentialRing

EntireRing

EuclideanDomain

GcdDomain

IntegralDomain

LeftOreRing

Magma

MagmaWithUnit

Monoid

multiplicativeValuation

NonAssociativeRing

NonAssociativeRng

NonAssociativeSemiRing

NonAssociativeSemiRng

noZeroDivisors

OrderedAbelianGroup

OrderedAbelianMonoid

OrderedAbelianSemiGroup

OrderedCancellationAbelianMonoid

OrderedIntegralDomain

OrderedRing

OrderedSet

PartialOrder

PrincipalIdealDomain

RealConstant

Ring

Rng

SemiGroup

SemiRing

SemiRng

SetCategory

StepThrough

TwoSidedRecip

UniqueFactorizationDomain

unitsKnown