Difference between revisions of "Operators"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "MiniScript defines the following operators (listed in order from lowest to highest precedence): {| class="wikitable" |- ! Operator !! Meaning |- | A <c>=</c> B || assignment...")
 
m
Line 32: Line 32:
 
|-
 
|-
 
| A <c>*</c> B || multiplication or replication
 
| A <c>*</c> B || multiplication or replication
|-
 
| A <c>/</c> B || division or reduction
 
 
|-
 
|-
 
| A <c>/</c> B || division or reduction
 
| A <c>/</c> B || division or reduction

Revision as of 03:21, 8 February 2021

MiniScript defines the following operators (listed in order from lowest to highest precedence):

Operator Meaning
A = B assignment
A or B logical OR: true if either operand is true
A and B logical AND: true if both operands are true
not A logical negation: true if its operand is false, and vice versa
A isa B type checking
A == B equality comparison: true if operands are equal
A != B inequality comparison: true if operands are not equal
A > B greater-than comparison
A < B less-than comparison
A >= B greater-than or equal-to comparison
A <= B less-than or equal-to comparison
A + B addition or concatenation
A - B subtraction or string trimming
A * B multiplication or replication
A / B division or reduction
-A unary minus (numeric negation)
new A instantiation
@A address-of (reference function without invoking it)
A ^ B power: A raised to the power of B
A.B dot operator