Operators

List of operators

Product: 

Class: 

Warning

uCalc API Preview Release Notice:The uCalc engine has successfully transitioned to modern cross-platform environments. The next phase envolvessome structural changes, performance optimizations, and API refinements. The API is subject to breaking changesprior to the stable release. Please evaluate the preview version thoroughly before production use.

Remarks

Precedence numbers are relative only—higher means tighter binding.


🔢 Integer Operators

PrecOperatorSignatureDescription
50x + y{x As Int} + {y As Int} As IntInteger addition.
50x - y{x As Int} - {y As Int} As IntInteger subtraction.
60x * y{x As Int} * {y As Int} As IntInteger multiplication.
60x / y{x As Int} / {y As Int} As IntInteger division (truncating).
60x % y{x As Int} % {y As Int} As IntInteger remainder.

🧮 Double‑Precision Operators

PrecOperatorSignatureDescription
50x + y{x} + {y}Floating‑point addition.
50x - y{x} - {y}Floating‑point subtraction.
60x * y{x} * {y}Floating‑point multiplication.
60x / y{x} / {y}Floating‑point division.
60x \\ y{x} \\ {y} = Trunc(x / y)Integer‑style division on doubles.
60x mod y{x} mod {y}Floating‑point modulo.
70+x+{x}Unary plus.
70-x-{x}Unary negation.
90x!{x}!Factorial.
80x ^ y{x} ^ {y As Int}Exponentiation with integer exponent.
80x ^ y{x} ^ {y}Exponentiation with floating exponent.

🔤 String Operators

PrecOperatorSignatureDescription
50x + y{ByHandle x As String} + {ByHandle y As AnyType} As StringString concatenation with automatic conversion.
50x + y{ByHandle x As AnyType} + {ByHandle y As String} As StringConcatenation (reverse order).
50x + y{x As String} + {y As String} As StringPure string concatenation.
30x & y{x As Int} & {y As Int} As IntBitwise AND for integers.
30x & y{ByHandle x As AnyType} & {ByHandle y As AnyType} As StringString concatenation operator (VB‑style).
60x * y{x As String} * {y As size_t} As StringString repetition.

🧭 Pointer Arithmetic

PrecOperatorSignatureDescription
50ptr + n{ByHandle x As AnyType Ptr} + {y As Int} As SameTypeAs:0 PtrPointer addition.
50ptr - n{ByHandle x As AnyType Ptr} - {y As Int} As SameTypeAs:0 PtrPointer subtraction.

🔍 Comparison Operators

(String, Int, Double, and generic overloads)

PrecOperatorSignatureDescription
40x == y{x As String} == {y As String} As BoolString equality.
40x <> y{x As String} <> {y As String} As BoolString inequality.
40<, >, <=, >=String versionsLexicographic comparisons.
40x == y{x As Int} == {y As Int} As BoolInteger equality.
40x <> y{x As Int} <> {y As Int} As BoolInteger inequality.
40<, >, <=, >=Integer versionsNumeric comparisons.
40x == y{x} == {y} As BoolGeneric equality.
40x <> y{x} <> {y} As BoolGeneric inequality.
40<, >, <=, >=Generic versionsType‑dependent comparisons.

🔢 Complex Operators

PrecOperatorSignatureDescription
50x + y{x As Complex} + {y As Complex} As ComplexComplex addition.
50x - y{x As Complex} - {y As Complex} As ComplexComplex subtraction.
60x * y{x As Complex} * {y As Complex} As ComplexComplex multiplication.
60x / y{x As Complex} / {y As Complex} As ComplexComplex division.
80x == y{x As Complex} == {y As Complex} As BoolComplex equality.
80x <> y{x As Complex} <> {y As Complex} As BoolComplex inequality.
80x ^ y{x As Complex} ^ {y As Complex} As ComplexComplex exponentiation.

🟦 Boolean Operators

PrecOperatorSignatureDescription
35!x! {x As Bool} As BoolLogical NOT.
35Not xNot {x As Bool} As BoolAlternative NOT.
30x && y{x As Bool} && {ByExpr y As Bool} As BoolLogical AND (short‑circuit).
30x And y{x As Bool} And {ByExpr y As Bool} As BoolLogical AND (non‑short‑circuit).
30x AndAlso y{x As Bool} AndAlso {ByExpr y As Bool} As BoolShort‑circuit AND (VB‑style).
20x || y{x As Bool} || {ByExpr y As Bool} As BoolLogical OR (short‑circuit).
20x Or y{x As Bool} Or {ByExpr y As Bool} As BoolLogical OR (non‑short‑circuit).
20x OrElse y{x As Bool} OrElse {ByExpr y As Bool} As BoolShort‑circuit OR (VB‑style).

🧱 Bitwise Operators

PrecOperatorSignatureDescription
35~x~ {x As Int} As IntBitwise NOT.
35Not xNot {x Int} As IntAlternative bitwise NOT.
30x And y{x As Int} And {y As Int} As IntBitwise AND.
30x BitAnd y{x As Int} BitAnd {y As Int} As IntExplicit bitwise AND.
20x | y{x As Int} | {y As Int} As IntBitwise OR.
20x Or y{x As Int} Or {y As Int} As IntBitwise OR (keyword).
20x BitOr y{x As Int} BitOr {y As Int} As IntExplicit bitwise OR.
20x Xor y{x As Int} Xor {y As Int} As IntBitwise XOR.
45x << y{x As Int} << {y As Int} As IntLeft shift.
45x >> y{x As Int} >> {y As Int} As IntRight shift.

📝 Assignment Operators

PrecAssocOperatorSignatureDescription
15Right‑to‑Leftx = y{ByRef x As AnyType} = {y As SameTypeAs:0} As SameTypeAs:0Generic assignment.
15Right‑to‑Leftx = y{ByRef x As String} = {y As String} As StringString assignment.
15Right‑to‑Leftx = y{ByRef x As Complex} = {y As Complex} As ComplexComplex assignment.

🔼 Increment / Decrement

OperatorDescription
++xPrefix increment.
x++Postfix increment.
--xPrefix decrement.
x--Postfix decrement.

🧩 Miscellaneous Operators

OperatorDescription
;Statement separator.
,Argument separator (comma operator).

Examples

This page last modified on: 

9/9/2026