Skip to main content

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

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

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

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

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.

example
pInt( -20 ).div( -3 ) // ==  -7

quot

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:

example
pInt( -20 ).quot( 3 ) // ==  -6

remainder

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:

example
pInt( -20 ).remainder( 3 ) // ==  -2

mod

mod

parameter: other type: Term<PInt>

returns TermInt

equivalent expression:

pmod.$( term ).$( other )

returns the term the method is defined on, in modulo other.

example
pInt( -20 ).mod( 3 ) // ==  1

eq

eq

parameter: other type: Term<PInt>

returns: TermBool

equivalent expression:

peqInt.$( term ).$( other )

integer equality

lt

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

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

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

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