Skip to content
Русский

​and_bool

and_bool returns the binary AND of the left- and right-hand-side arguments.

​Inputs

NameTypeDescription
lhsboolA boolean value
rhsboolA boolean value

​Output

NameTypeDescription
valueboolThe result of a binary AND between the two arguments

​or_bool

or_bool returns the binary OR of the left- and right-hand-side arguments.

​Inputs

NameTypeDescription
lhsboolA boolean value
rhsboolA boolean value

​Output

NameTypeDescription
valueboolThe result of a binary OR between the two arguments

​div

div returns the integer division of the left-hand-side argument by the right-hand-side argument, truncating the result toward zero (11 / -3 and -11 / 3 both return -3). Dividing by zero returns an error.

​Inputs

NameTypeDescription
lhsintegerThe dividend
rhsintegerThe divisor

​Output

NameTypeDescription
valueintegerThe result of dividing the dividend by the divisor

​eq

eq returns true if the left- and right-hand-side arguments are equal and false if they are not.

​Inputs

NameTypeDescription
lhsanyAny value
rhsanyAny value

​Output

NameTypeDescription
valueboolThe result of an equality check between the two inputs

​gt

gt returns true if the left-hand-side argument is greater than the right-hand-side argument.

​Inputs

NameTypeDescription
lhsintegerAn integer value
rhsintegerAn integer value

​Output

NameTypeDescription
valueboolThe result of checking if the left-hand-side argument is greater than the right-hand-side argument

​gte

gte returns true if the left-hand-side argument is greater than or equal to the right-hand-side argument.

​Inputs

NameTypeDescription
lhsintegerAn integer value
rhsintegerAn integer value

​Output

NameTypeDescription
valueboolThe result of checking if the left-hand-side argument is greater than or equal to the right-hand-side argument

​lt

lt returns true if the left-hand-side argument is less than the right-hand-side argument.

​Inputs

NameTypeDescription
lhsintegerAn integer value
rhsintegerAn integer value

​Output

NameTypeDescription
valueboolThe result of checking if the left-hand-side argument is less than the right-hand-side argument

​lte

lte returns true if the left-hand-side argument is less than or equal to the right-hand-side argument.

​Inputs

NameTypeDescription
lhsintegerAn integer value
rhsintegerAn integer value

​Output

NameTypeDescription
valueboolThe result of checking if the left-hand-side argument is less than or equal to the right-hand-side argument

​neq

neq returns true if the left- and right-hand-side arguments are not equal and false otherwise.

​Inputs

NameTypeDescription
lhsintegerAn integer to compare
rhsintegerAn integer to compare it against

​Output

NameTypeDescription
valueboolThe result of a negated equality check between the two inputs
In Surfpool 1.6.1 and 1.7.0, != (or std::neq) only works on two integers: comparing strings, floats or booleans panics. Until the upstream txtx runtime fixes it, store the == result in a variable and compare that with false (variable.same == false).

​minus

minus returns the result of subtracting the right-hand-side integer argument from the left-hand-side integer argument.

​Inputs

NameTypeDescription
lhsintegerThe minuend
rhsintegerThe subtrahend

​Output

NameTypeDescription
valueintegerThe result of the subtraction operation

​modulo

modulo returns the remainder of dividing the left-hand-side integer argument by the right-hand-side integer argument.

​Inputs

NameTypeDescription
lhsintegerThe dividend
rhsintegerThe divisor

​Output

NameTypeDescription
valueintegerThe remainder of the division operation

​multiply

multiply returns the product of the left-hand-side integer argument and the right-hand-side integer argument.

​Inputs

NameTypeDescription
lhsintegerThe first operand
rhsintegerThe second operand

​Output

NameTypeDescription
valueintegerThe result of the multiplication operation

​add

add returns the sum of the left-hand-side integer argument and the right-hand-side integer argument.

​Inputs

NameTypeDescription
lhsintegerThe first operand
rhsintegerThe second operand

​Output

NameTypeDescription
valueintegerThe result of the addition operation

​neg_integer

Returns the negation of the given integer.
std::neg_integer isn’t implemented in Surfpool 1.7.0: calling it panics. Write a negative literal (-5) or subtract from zero (0 - x) instead.

​Inputs

NameTypeDescription
valueintegerAn integer value

​Output

NameTypeDescription
valueintegerThe negated integer value

​not_bool

Returns the logical negation of the given boolean value.
std::not_bool and the ! operator aren’t implemented in Surfpool 1.7.0: both panic. Compare with == instead, for example value == false.

​Inputs

NameTypeDescription
valueboolA boolean value

​Output

NameTypeDescription
valueboolThe logical negation of the input boolean value