TermInt
type definition:
type TermInt = Term<PInt> & {
readonly addTerm: TermFn<[PInt], PInt>
readonly add: ( other: Term<PInt> ) => TermInt
readonly subTerm: TermFn<[PInt], PInt>
readonly sub: ( other: Term<PInt> ) => TermInt
readonly multTerm: TermFn<[PInt], PInt>
readonly mult: ( other: Term<PInt> ) => TermInt
readonly divTerm: TermFn<[PInt], PInt>
readonly div: ( other: Term<PInt> ) => TermInt
readonly quotTerm: TermFn<[PInt], PInt>
readonly quot: ( other: Term<PInt> ) => TermInt
readonly remainderTerm: TermFn<[PInt], PInt>
readonly remainder: ( other: Term<PInt> ) => TermInt
readonly modTerm: TermFn<[PInt], PInt>
readonly mod: ( other: Term<PInt> ) => TermInt
readonly eqTerm: TermFn<[PInt], PBool>
readonly eq: ( other: Term<PInt> ) => TermBool
readonly ltTerm: TermFn<[PInt], PBool>
readonly lt: ( other: Term<PInt> ) => TermBool
readonly ltEqTerm: TermFn<[PInt], PBool>
readonly ltEq: ( other: Term<PInt> ) => TermBool
readonly gtTerm: TermFn<[PInt], PBool>
readonly gt: ( other: Term<PInt> ) => TermBool
readonly gtEqTerm: TermFn<[PInt], PBool>
readonly gtEq: ( other: Term<PInt> ) => TermBool
};
add
parameter:
other
type:Term<PInt>
returns
TermInt
equivalent expression:
padd.$( term ).$( other )
adds other
to the term is defined on and returns the result
sub
parameter:
other
type:Term<PInt>
returns
TermInt
equivalent expression:
psub.$( term ).$( other )
subtracts other
to the term is defined on and returns the result
mult
parameter:
other
type:Term<PInt>
returns
TermInt
equivalent expression:
pmult.$( term ).$( other )
multiplies other
to the term is defined on and returns the result
div
parameter:
other
type:Term<PInt>
returns
TermInt
equivalent expression:
pdiv.$( term ).$( other )
performs integer division using the term is defined on and other
as divisor; returns the result rounded towards negative infinity:
exaxmple:
pInt( -20 ).div( pInt( -3 ) ) // == -7
quot
parameter:
other
type:Term<PInt>
returns
TermInt
equivalent expression:
pquot.$( term ).$( other )
performs integer division using the term is defined on and other
as divisor; returns the quotient rounded towards zero:
exaxmple:
pInt( -20 ).quot( pInt( 3 ) ) // == -6
remainder
parameter:
other
type:Term<PInt>
returns
TermInt
equivalent expression:
prem.$( term ).$( other )
performs integer division using the term is defined on and other
as divisor; returns the remainder:
exaxmple:
pInt( -20 ).remainder( pInt( 3 ) ) // == -2
mod
parameter:
other
type:Term<PInt>
returns
TermInt
equivalent expression:
pmod.$( term ).$( other )
returns the term the method is defined on, in modulo other
.
exaxmple:
pInt( -20 ).mod( pInt( 3 ) ) // == 1
eq
parameter:
other
type:Term<PInt>
returns:
TermBool
equivalent expression:
peqInt.$( term ).$( other )
integer equality
lt
parameter:
other
type:Term<PInt>
returns:
TermBool
equivalent expression:
plessInt.$( term ).$( other )
returns pBool( true )
if term
is strictly less than other
; pBool( false )
otherwise
ltEq
parameter:
other
type:Term<PInt>
returns:
TermBool
equivalent expression:
plessEqInt.$( term ).$( other )
returns pBool( true )
if term
is less or equal to other
; pBool( false )
otherwise
gt
parameter:
other
type:Term<PInt>
returns:
TermBool
equivalent expression:
pgreaterInt.$( term ).$( other )
returns pBool( true )
if term
is strictly greater than other
; pBool( false )
otherwise
gtEq
parameter:
other
type:Term<PInt>
returns:
TermBool
equivalent expression:
pgreaterEqInt.$( term ).$( other )
returns pBool( true )
if term
is greater or equal to other
; pBool( false )
otherwise