1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
# algebraic expressions do whatever one expects them to do
# thus a should evaluate to 7
a = 1 + 2*3
# and b should evaluate to 9
b = (1+2) * 3
# expressions can contain variables and functions, whose
# arguments may be expressions themselves, and so on
c = (1 + sin(pi/4)^(5/2))/(1 - log(abs(a-b)))
PRINT %g a b c
# when an expression appears as an argument of a keyword and
# contains spaces it should be written within double quotes
# so the parser can tell it is a single expression
PRINT %g 1 -1 "1 -1"
|