Skip to content

Numbers

Giorgio Garofalo edited this page Jun 16, 2022 · 4 revisions

If a string is entirely numeric it is automatically interpreted as a number. This is what defining a number with value 10 (rgb(49, 49, 49) + rgb(48, 48, 48)) looks like:

Number

Now let's try out some arithmetic operations. First, we'll add 3 to its value via op.plus (which works with strings as well):

Sum

Operations can also be chained. Let's subtract 6 from the previous result via op.minus :

Subtraction

Operators work with other data as well, such as variables. Here we define a variable (brown ) whose value is added to another (orange ):

Sum with variables

Other arithmetic operators are: op.times (*) , op.divide (/) and op.modulo (%) .