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 BasicType

>=: (%, %) -> Boolean

from PartialOrder

>: (%, %) -> Boolean

from PartialOrder

^: (%, NonNegativeInteger) -> %

from MagmaWithUnit

^: (%, PositiveInteger) -> %

from Magma

~=: (%, %) -> Boolean

from BasicType

antiCommutator: (%, %) -> %

from NonAssociativeSemiRng

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 of a and b, or “failed” if b is zero or a rem b is zero.

gcd: (%, %) -> %

gcd(a, b) computes the greatest common divisor of two non negative integers a and b.

hash: % -> SingleInteger

from Hashable

hashUpdate!: (HashState, %) -> HashState

from Hashable

inf: (%, %) -> %

from OrderedAbelianMonoidSup

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) coerces n to \% trusting that n is nonnegative

quo: (%, %) -> %

a quo b returns the quotient of a and b, forgetting the remainder.

random: % -> %

random(n) returns a random integer from 0 to n-1.

recip: % -> Union(%, failed)

from MagmaWithUnit

rem: (%, %) -> %

a rem b returns the remainder of a and b.

rightPower: (%, NonNegativeInteger) -> %

from MagmaWithUnit

rightPower: (%, PositiveInteger) -> %

from Magma

rightRecip: % -> Union(%, failed)

from MagmaWithUnit

sample: %

from AbelianMonoid

shift: (%, Integer) -> %

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

smaller?: (%, %) -> Boolean

from Comparable

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

from CancellationAbelianMonoid

sup: (%, %) -> %

from OrderedAbelianMonoidSup

zero?: % -> Boolean

from AbelianMonoid

AbelianMonoid

AbelianSemiGroup

BasicType

BiModule(%, %)

CancellationAbelianMonoid

CoercibleTo OutputForm

CommutativeStar

Comparable

ConvertibleTo InputForm

Hashable

LeftModule %

Magma

MagmaWithUnit

Monoid

NonAssociativeSemiRing

NonAssociativeSemiRng

OrderedAbelianMonoid

OrderedAbelianMonoidSup

OrderedAbelianSemiGroup

OrderedCancellationAbelianMonoid

OrderedSet

PartialOrder

RightModule %

SemiGroup

SemiRing

SemiRng

SetCategory

TwoSidedRecip