native.ops
The interpreter’s native implementations of arithmetic, comparison, and truth testing.
All modules · Writing docstrings
func add(left, right)Dispatches +; supported operands and result depend on their runtime types.
func sub(left, right)Dispatches -; numeric operands must be compatible.
func mul(left, right)Dispatches *; numeric operands must be compatible.
func div(left, right)Dispatches /; rejects a zero divisor.
func mod(left, right)Dispatches %; rejects a zero divisor and follows the divisor sign.
func eq(left, right): BoolDispatches equality, including cross-comparison between Int and Float.
func ne(left, right): BoolDispatches inequality.
func lt(left, right): BoolDispatches < for comparable numeric, string, byte, or char values.
func gt(left, right): BoolDispatches > for comparable numeric, string, byte, or char values.
func le(left, right): BoolDispatches <= for comparable numeric, string, byte, or char values.
func ge(left, right): BoolDispatches >= for comparable numeric, string, byte, or char values.
func neg(value)Dispatches unary numeric negation.
func not(value)Dispatches unary logical negation.
func truth(value): BoolReturns KataScript truthiness: nil, false, zero numbers, empty strings, and empty tuples/records are false.