Home Manual Packages Global Index Keywords Quick Reference Language Reference Starting and Quitting Yorick Getting Help Error Recovery Array Data Types Constants Defining Variables Arithmetic and Comparison Operators Logical Operators Creating Arrays Indexing Arrays Array Conformability Rules Calling Functions Defining Functions Variable Scope Returning from Functions Compound Statements Conditional Execution Loops Function Reference I/O Reference | # Yorick Language Reference ## Arithmetic and Comparison Operators From highest to lowest precedence, `^` raise to power `* / %` multiply, divide, modulo `+ -` add, subtract (also unary plus, minus) `<< >>` shift left, shift right `>= < <= >` (not) less, (not) greater (`int` result) `== !=` equal, not equal (`int` result) `&` bitwise and `~` bitwise xor (also unary bitwise complement) `|` bitwise or `=` redefine or assign Any binary operator may be prefixed to `=` to produce an increment operator; thus `x*=5` is equivalent to `x=x*5`. Also, `++x` and `--x` are equivalent to `x+=1` and `x-=1`, respectively. Finally, `x++` and `x--` increment or decrement `x` by 1, but return the value of `x` before the operation.