See also PositiveInteger spad )abbrev domain NNI NonNegativeInteger
++ Author:
++ Date Created:
++ Change History:
++ Basic Operations:
++ Related Constructors:
++ Keywords: integer
++ Description: \spadtype{NonNegativeInteger} provides functions for non
++ negative integers.
NonNegativeInteger: Join(OrderedAbelianMonoidSup,Monoid) with
_quo : (%,%) -> %
++ a quo b returns the quotient of \spad{a} and b, forgetting
++ the remainder.
_rem : (%,%) -> %
++ a rem b returns the remainder of \spad{a} and b.
gcd : (%,%) -> %
++ gcd(a,b) computes the greatest common divisor of two
++ non negative integers \spad{a} and b.
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 \spad{a} and b, or "failed"
++ if b is zero or \spad{a} rem b is zero.
shift: (%, Integer) -> %
++ shift(a,i) shift \spad{a} by i bits.
random : % -> %
++ random(n) returns a random integer from 0 to \spad{n-1}.
commutative("*")
++ commutative("*") means multiplication is commutative : \spad{x*y = y*x}.
spad Compiling FriCAS source code from file
/var/zope2/var/LatexWiki/5780123711064895556-25px001.spad using
old system compiler.
NNI abbreviates domain NonNegativeInteger
------------------------------------------------------------------------
initializing NRLIB NNI for NonNegativeInteger
compiling into NRLIB NNI
****** comp fails at level 1 with expression: ******
((+-> |x|
(IF (< |x| 0)
|false|
|true|)))
****** level 1 ******
$x:= (+-> x (IF (< x (Zero)) false true))
$m:= (Boolean)
$f:=
((((|#1| #) (* #) (+ #) (- #) ...)))axiom )show NonNegativeInteger |