operators
Index

Operators

The operators +, -, *, /, and ^ are used to perform addition, subtraction, multiplication, division, exponentiation of floating point and integer numbers. Valid operands are numeric constants and/or numeric variables.

The operators %, \, &, |, and ~ are used to calculate modulo, integer division, bitwise and, bitwise or, and bitwise negation (not) of integer expressions. Floating point numbers will be coverted to an integer value before calculation.

The = operator is used both for assignment to variables, and to test for equality. The + operator may be used to perform concatenation of any combination of string constants and string variables. The : operator can separate multiple statements on a single line. The ; operator suppresses the new line that is printed from a PRINT statement. The # operator is a shortcut for the Rem statement, and is interchangeable with it.

Order of Operations
LevelOperatorsCategory/Description
1( )Grouping
2^Exponent
3- ~Unary Minus and Bitwise Negation (NOT)
4* / \Multiplication and Division
5%Integer Remainder (Mod)
6+ -Addition, Concatenation, and Subtraction
7& |Bitwise And and Bitwise Or
8< <= > >= = <>Comparison (Numeric and String)
9NOTUnary Not
10ANDLogical And
11ORLogical Or
12XORLogical Exclusive Or