Number expressions

A number expression uses operators plus (+), minus (-), multiply (*), divide (/) and modulus (%), as well as parenthesis (). For example:
 set-number n1 = 10+(4*n2-5)%3

You can use number expressions anywhere number is expected as an input to any statement.

Note that character constants (such as 'A', 'z' etc.) are considered numbers with the value equal to their single-byte ASCII equivalent (i.e. unsigned numbers 0-255), for example this will assign 65 to "num":
 set-number num = 'A'

Any subscripted string is also considered a number, for instance "num" would be 117 (since 's' is 115):
 set-string str = 'some'
 set-number num = str[0] + 2

See also
Numbers
number-expressions  
number-string  
set-number  
string-number  
See all
documentation


Copyright (c) 2019-2025 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.