-
Notifications
You must be signed in to change notification settings - Fork 0
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:
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):
Operations can also be chained. Let's subtract 6 from the previous result via op.minus
:
Operators work with other data as well, such as variables. Here we define a variable (brown ) whose value is added to another (orange ):
Other arithmetic operators are: op.times
(*
) , op.divide
(/
) and op.modulo
(%
) .