Operators

Arithmetic

Add (+)

Return the result of adding 2 numbers together

 

{ }
[{"data":{"type":"library","step":"Add 3 + 4","call":"operators.arithmetic.+","args":{"item1":3,"item2":4},"data_to_var":"result","maxpaths":1,"uuid":"f94d5d78ee92c714f7995c56169b74be","x":489,"y":239,"width":120,"height":32,"operators":"operators","operators.arithmetic.+":"+"},"paths":[]}]

Example Response

{"result":7}

Subtract (-)

Return the result of subtracting a number from another

 

{ }
[{"data":{"type":"library","step":"Subtract 4 - 3","call":"operators.arithmetic.-","args":{"item1":4,"item2":3},"data_to_var":"result","maxpaths":1,"uuid":"f94d5d78ee92c714f7995c56169b74be","x":489,"y":239,"width":120,"height":32,"operators":"operators","operators.arithmetic.-":"-"},"paths":[]}]

Example Response

{"result":1}

Mulitply (*)

Return the result of multiplying a number by another

 

{ }
[{"data":{"type":"library","step":"Multiply 2 * 3","call":"operators.arithmetic.*","args":{"item1":2,"item2":3},"data_to_var":"result","maxpaths":1,"uuid":"f94d5d78ee92c714f7995c56169b74be","x":489,"y":239,"width":120,"height":32,"operators":"operators","operators.arithmetic.*":"*"},"paths":[]}]

Example Response

{"result":6}

Divide (/)

Return the result of dividing a number by another

 

{ }
[{"data":{"type":"library","step":"Divide 4 \/ 2","call":"operators.arithmetic.\/","args":{"item1":4,"item2":2},"data_to_var":"result","maxpaths":1,"uuid":"f94d5d78ee92c714f7995c56169b74be","x":489,"y":239,"width":120,"height":32,"operators":"operators","operators.arithmetic.\/":"\/"},"paths":[]}]

Example Response

{"result":2}

Modulo (%)

The % (modulo) operator yields the remainder from the division of the first argument by the second. The numeric arguments are first converted to a common type. A zero right argument raises the ZeroDivisionError exception. The arguments may be floating point numbers, e.g., 3.14%0.7 equals 0.34 (since 3.14 equals 4*0.7 + 0.34.) The modulo operator always yields a result with the same sign as its second operand (or zero); the absolute value of the result is strictly smaller than the absolute value of the second operand [2].

 

{ }
[{"data":{"type":"library","step":"Get modulo 3.14 % 0.7","call":"operators.arithmetic.%","args":{"item1":3.14,"item2":0.7},"data_to_var":"result","maxpaths":1,"uuid":"f94d5d78ee92c714f7995c56169b74be","x":489,"y":239,"width":120,"height":32,"operators":"operators","operators.arithmetic.%":"%"},"paths":[]}]

Example Response

{"result":0.34}

Divide & Floor (//)

Divide the first number by the second and then return the whole number rounded down.

 

{ }
[{"data":{"type":"library","step":"Divide & floor 9 \/\/ 2 ","call":"operators.arithmetic.\/\/","args":{"item1":9,"item2":2},"data_to_var":"result","maxpaths":1,"uuid":"f94d5d78ee92c714f7995c56169b74be","x":489,"y":239,"width":120,"height":32,"operators":"operators","operators.arithmetic.\/\/":"\/\/"},"paths":[]}]

Example Response

{"result":4}

Power (**)

Return the first number to the power of the second number.

 

{ }
[{"data":{"type":"library","step":"9 to the power of 2","call":"operators.arithmetic.**","args":{"item1":9,"item2":2},"data_to_var":"result","maxpaths":1,"uuid":"f94d5d78ee92c714f7995c56169b74be","x":489,"y":239,"width":120,"height":32,"operators":"operators","operators.arithmetic.**":"**"},"paths":[]}]

Example Response

{"result":81}

Increment (++)

Add 1 to the value and then return it

 

{ }
[{"data":{"type":"variable","step":"x = 10","var":"x","val":10,"maxpaths":1,"uuid":"d7db099a1a3f9e2df693cd4422bb26cb","x":300,"y":320,"width":120,"height":32},"paths":["9148d39266042bc89aff74e46b1a483b"]},{"data":{"type":"library","step":"increment x","call":"operators.arithmetic.++","args":{"item":"{\"~\":\"x\"}"},"maxpaths":1,"uuid":"9148d39266042bc89aff74e46b1a483b","x":300,"y":400,"width":120,"height":32,"operators":"operators","operators.arithmetic.++":"++"},"paths":[]}]

Example Response

{"x":11}

Decrement (--)

Subtract 1 from the value and then return it

 

{ }
[{"data":{"type":"variable","step":"x = 10","var":"x","val":10,"maxpaths":1,"uuid":"d7db099a1a3f9e2df693cd4422bb26cb","x":300,"y":320,"width":120,"height":32},"paths":["9148d39266042bc89aff74e46b1a483b"]},{"data":{"type":"library","step":"decrement x","call":"operators.arithmetic.--","args":{"item":"{\"~\":\"x\"}"},"maxpaths":1,"uuid":"9148d39266042bc89aff74e46b1a483b","x":300,"y":400,"width":120,"height":32,"operators":"operators","operators.arithmetic.--":"--"},"paths":[]}]

Example Response

{"x":9}