Skip to content

Expressions

LabRicecat edited this page Nov 25, 2022 · 5 revisions

Expressions are inside normal braces ().
There are no unary operators in MeowScript.

+ (Plus)

Adds both sides.

Priority: 1

- (Minus)

Subtracts right from `left.

Priority: 1

* (Times)

Multiplies both sides.

Priority: 2

/ (Division)

Divides left through right and throws and error if right is 0.

Priority: 2

% (Modolo)

Returns left mod right and throws an error if right is 0.

Priority: 2

^ (Power)

Returns left to the power of right.

Priority: 3

== (Equals)

Returns 1 if left is equal to right, else 0.

Priority: 0

!= (not Equals)

Returns 1 if left is not equal to right, else 0.

Priority: 0

> (Greater)

Returns 1 if left is greater than right, else 0.

Priority: 0

< (Smaller)

Returns 1 if left is smaller than right, else 0.

Priority: 0

>= (Equal or greater)

Returns 1 if left is equal to, or greater than right, else 0.

Priority: 0

<= (Equalsor smaller)

Returns 1 if left is equal to, or smaller than right, else 0.

Priority: 0

&& (And)

Returns 1 if left and right are equal to 1, else 0.

Priority: -1

|| (Or)

Returns 1 if left or right are equal to 1, else 0.

Priority: -1

^^ (Exclusive or)

Returns 1 if left or right are equal to 1, but not both, else 0.

Priority: -1

= (Assign)

Sets variable left to right. Returns void.
Errors if left is not a variable.

Priority: -999

>>> Next Article

Clone this wiki locally