IntegerNumberSystem¶
si.spad line 1 [edit on github]
An IntegerNumberSystem
is a model for the integers.
- 0: %
from AbelianMonoid
- 1: %
from MagmaWithUnit
- *: (%, %) -> %
from Magma
- *: (Integer, %) -> %
from AbelianGroup
- *: (NonNegativeInteger, %) -> %
from AbelianMonoid
- *: (PositiveInteger, %) -> %
from AbelianSemiGroup
- +: (%, %) -> %
from AbelianSemiGroup
- -: % -> %
from AbelianGroup
- -: (%, %) -> %
from AbelianGroup
- <=: (%, %) -> Boolean
from PartialOrder
- <: (%, %) -> Boolean
from PartialOrder
- >=: (%, %) -> Boolean
from PartialOrder
- >: (%, %) -> Boolean
from PartialOrder
- ^: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- ^: (%, PositiveInteger) -> %
from Magma
- abs: % -> %
from OrderedRing
- addmod: (%, %, %) -> %
addmod(a, b, p)
,0<=a, b<p>1
, meansa+b mod p
.
- annihilate?: (%, %) -> Boolean
from Rng
- antiCommutator: (%, %) -> %
- associates?: (%, %) -> Boolean
from EntireRing
- associator: (%, %, %) -> %
from NonAssociativeRng
- base: () -> %
base()
returns the base for the operations ofIntegerNumberSystem
.
- binomial: (%, %) -> %
- bit?: (%, %) -> Boolean
bit?(n, i)
returnstrue
if and only ifi
-th bit ofn
is a 1.
- characteristic: () -> NonNegativeInteger
from NonAssociativeRing
- coerce: % -> %
from Algebra %
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- coerce: Integer -> %
from NonAssociativeRing
- commutator: (%, %) -> %
from NonAssociativeRng
- convert: % -> DoubleFloat
from ConvertibleTo DoubleFloat
- convert: % -> Float
from ConvertibleTo Float
- convert: % -> InputForm
from ConvertibleTo InputForm
- convert: % -> Integer
from ConvertibleTo Integer
- convert: % -> Pattern Integer
from ConvertibleTo Pattern Integer
- copy: % -> %
copy(n)
gives a copy ofn
.
- D: % -> %
from DifferentialRing
- D: (%, NonNegativeInteger) -> %
from DifferentialRing
- dec: % -> %
dec(x)
returnsx - 1
.
- differentiate: % -> %
from DifferentialRing
- differentiate: (%, NonNegativeInteger) -> %
from DifferentialRing
- divide: (%, %) -> Record(quotient: %, remainder: %)
from EuclideanDomain
- euclideanSize: % -> NonNegativeInteger
from EuclideanDomain
- even?: % -> Boolean
even?(n)
returnstrue
if and only ifn
is even.
- expressIdealMember: (List %, %) -> Union(List %, failed)
from PrincipalIdealDomain
- exquo: (%, %) -> Union(%, failed)
from EntireRing
- extendedEuclidean: (%, %) -> Record(coef1: %, coef2: %, generator: %)
from EuclideanDomain
- extendedEuclidean: (%, %, %) -> Union(Record(coef1: %, coef2: %), failed)
from EuclideanDomain
- factorial: % -> %
- gcdPolynomial: (SparseUnivariatePolynomial %, SparseUnivariatePolynomial %) -> SparseUnivariatePolynomial %
from GcdDomain
- inc: % -> %
inc(x)
returnsx + 1
.
- init: %
from StepThrough
- invmod: (%, %) -> %
invmod(a, b)
,0<=a<b>1
,(a, b)=1
means1/a mod b
.
- latex: % -> String
from SetCategory
- 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 ofa
in digits.
- mask: % -> %
mask(n)
returns2^n-1
(ann
bit mask).
- max: (%, %) -> %
from OrderedSet
- min: (%, %) -> %
from OrderedSet
- mulmod: (%, %, %) -> %
mulmod(a, b, p)
,0<=a, b<p>1
, meansa*b mod p
.
- multiEuclidean: (List %, %) -> Union(List %, failed)
from EuclideanDomain
- negative?: % -> Boolean
from OrderedRing
- nextItem: % -> Union(%, failed)
from StepThrough
- odd?: % -> Boolean
odd?(n)
returnstrue
if and only ifn
is odd.
- one?: % -> Boolean
from MagmaWithUnit
- opposite?: (%, %) -> Boolean
from AbelianMonoid
- patternMatch: (%, Pattern Integer, PatternMatchResult(Integer, %)) -> PatternMatchResult(Integer, %)
from PatternMatchable Integer
- permutation: (%, %) -> %
- plenaryPower: (%, PositiveInteger) -> %
from NonAssociativeAlgebra %
- positive?: % -> Boolean
from OrderedRing
- positiveRemainder: (%, %) -> %
positiveRemainder(a, b)
(whereb > 1
) yieldsr
where0 <= r < b
andr = a rem b
.
- powmod: (%, %, %) -> %
powmod(a, b, p)
,0<=a, b<p>1
, meansa^b mod p
.
- principalIdeal: List % -> Record(coef: List %, generator: %)
from PrincipalIdealDomain
- quo: (%, %) -> %
from EuclideanDomain
- random: % -> %
random(n)
creates a random element from 0 ton-1
.
- rational?: % -> Boolean
rational?(n)
tests ifn
is 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
from RetractableTo Integer
- retractIfCan: % -> Union(Integer, failed)
from RetractableTo Integer
- rightPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- rightPower: (%, PositiveInteger) -> %
from Magma
- rightRecip: % -> Union(%, failed)
from MagmaWithUnit
- sample: %
from AbelianMonoid
- shift: (%, %) -> %
shift(a, i)
shifta
byi
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
, meansa-b mod p
.
- subtractIfCan: (%, %) -> Union(%, failed)
- symmetricRemainder: (%, %) -> %
symmetricRemainder(a, b)
(whereb > 1
) yieldsr
where-b/2 < r <= b/2
.
- unit?: % -> Boolean
from EntireRing
- unitCanonical: % -> %
from EntireRing
- unitNormal: % -> Record(unit: %, canonical: %, associate: %)
from EntireRing
- zero?: % -> Boolean
from AbelianMonoid
Algebra %
BiModule(%, %)
Module %