Skip to content

Expression 2 Number

shadow7483147 edited this page Jul 21, 2020 · 18 revisions

This is a full list of functions provided by E2's number extension. It will also include syntax for comparison operations and bitwise ops.

Example are shown here: Expression 2 Examples: Number

Comparison

Syntax Example Description
> if ( A>8 ) {} Greater than comparison. Returns 1 when the left value is greater than the right value.
< if ( A<4 ) {} Less than comparison. Returns 1 when the left value is less than the right value.
>= if ( A>=6 ) {} Returns 1 when the right value is either greater than or equal to the left value.
<= if ( A<=14 ) {} Returns 1 when the right value is either less than or equal to the left value.

Arithmetic

haha numbers go wheeeeeeee

Syntax Example Description
+ 3 + 8 If you don't know what this does, I feel sorry for you.
- A - B Subtracts the right value from the left value, and returns the result.
C * D Multiplies the right and left values together, and returns the result. This can also multiply vectors as a magnitude!
/ E / F Divides the left value over the right value and returns an exact decimal answer.
% E % F Divides the left value over the right value, and returns the remainder of the division.
^ 4 ^ N Raises the left value to the Nth power exponent, and returns the result.

Assignment

Number variables can be reassigned a new value based on an arithmetic operator by simply appending an equal sign after it.
The format A += B, is equivalent to doing A = A + B. This works for any arithmetic operation.

There is also a shorthand form of this to increment/decrement a variable by just 1.

Syntax Example Description
+= A += B - C Sets the variable A equal to itself, plus B-C.
-= A -= B + C Sets the variable A equal to itself, minus B+C.
  • =
if (A>8) {} Returns 1 when the right value is either greater than or equal to the left value.
/= if (A>8) {} Returns 1 when the right value is either less than or equal to the left value.
%= if (A>8) {} Returns 1 when the right value is either less than or equal to the left value.
^= if (A>8) {} Returns 1 when the right value is either less than or equal to the left value.

Expression 2 ⚙️

Getting Started 🕊

Guides (In learning order) 🎓

Tools 🛠️

Click To Expand

Advanced

Beacon 💡

Control 🎛️

Data 💿

Detection 👀

Display 💻

Render 🖌

I/O 🔌

Physics 🚀

Utilities 🛠️

RFID 💳

Wireless 🛜

Gates 🚥

Click To Expand

TBD

Extras 🔭

Clone this wiki locally