File: algebraic_expr.fee

package info (click to toggle)
feenox 1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,068 kB
  • sloc: ansic: 28,856; sh: 7,201; makefile: 556; python: 554; xml: 500
file content (16 lines) | stat: -rw-r--r-- 511 bytes parent folder | download | duplicates (2)
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"