NonNegativeInteger¶
integer.spad line 213 [edit on github]
NonNegativeInteger provides functions for non negative integers.
- 0: %
from AbelianMonoid
- 1: %
from MagmaWithUnit
- *: (%, %) -> %
from LeftModule %
- *: (NonNegativeInteger, %) -> %
from AbelianMonoid
- *: (PositiveInteger, %) -> %
from AbelianSemiGroup
- +: (%, %) -> %
from AbelianSemiGroup
- <=: (%, %) -> Boolean
from PartialOrder
- <: (%, %) -> Boolean
from PartialOrder
- >=: (%, %) -> Boolean
from PartialOrder
- >: (%, %) -> Boolean
from PartialOrder
- ^: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- ^: (%, PositiveInteger) -> %
from Magma
- antiCommutator: (%, %) -> %
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- convert: % -> InputForm
from ConvertibleTo InputForm
- divide: (%, %) -> Record(quotient: %, remainder: %)
divide(a, b)
returns a record containing both remainder and quotient.
- exquo: (%, %) -> Union(%, failed)
exquo(a,b)
returns the quotient ofa
andb
, or “failed” ifb
is zero ora
remb
is zero.
- gcd: (%, %) -> %
gcd(a, b)
computes the greatest common divisor of two non negative integersa
andb
.
- hash: % -> SingleInteger
from Hashable
- hashUpdate!: (HashState, %) -> HashState
from Hashable
- inf: (%, %) -> %
- latex: % -> String
from SetCategory
- leftPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- leftPower: (%, PositiveInteger) -> %
from Magma
- leftRecip: % -> Union(%, failed)
from MagmaWithUnit
- max: (%, %) -> %
from OrderedSet
- min: (%, %) -> %
from OrderedSet
- one?: % -> Boolean
from MagmaWithUnit
- opposite?: (%, %) -> Boolean
from AbelianMonoid
- qcoerce: Integer -> %
qcoerce(n)
coercesn
to\%
trusting thatn
is nonnegative
- quo: (%, %) -> %
a quo b
returns the quotient ofa
andb
, forgetting the remainder.
- random: % -> %
random(n)
returns a random integer from 0 ton-1
.
- recip: % -> Union(%, failed)
from MagmaWithUnit
- rem: (%, %) -> %
a rem b
returns the remainder ofa
andb
.
- rightPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- rightPower: (%, PositiveInteger) -> %
from Magma
- rightRecip: % -> Union(%, failed)
from MagmaWithUnit
- sample: %
from AbelianMonoid
- shift: (%, Integer) -> %
shift(a, i)
shifta
byi
bits.
- smaller?: (%, %) -> Boolean
from Comparable
- subtractIfCan: (%, %) -> Union(%, failed)
- sup: (%, %) -> %
- zero?: % -> Boolean
from AbelianMonoid
BiModule(%, %)