Next: References Up: A Calculator for Exact Previous: Limits

# Expression Language

Figure C.1 illustrates the grammar of the expression language. It was automatically generated by Peter Thiemann's Ebnf2ps'' package.

1

Calculator version 1.0:

==> (1/3)
(1/3)
2^(1) * 0.  2 -4 7 -4 7 -4 7 -4 7 -4
= 0.3333333333

==> (1/3)*3
(1/3)*3
2^(4) * 0.  0 6 2 5 0 0 0 0 0 0 0
= 1

==> a := sin(pi/3)
a := sin(pi/3)
Okay.

==> b := exp(2)
b := exp(2)
Okay.

==> sqrt(b+(7*a-3))
sqrt(b+(7*a-3))
2^(3) * 0.  4 0 4 1 0 5 -4 0 3 -1
= 3.2328368232

==> Digits:=35
Digits:=35
Digits = 35

==> pi
pi
2^(5) * 0.  1 0 -2 2 -2 -5 -2 -3 0 4 2 5 -3 -2 1 0 4 -1
-3 0 2 0 -4 -2 -4 0 6 -3 3 -2 -5 -2 4 5 -4 5
= 3.14159265358979323846264338327950288

==> c := 3
c := 3
Okay.

==> d := c+1
d := c+1
Okay.

==> Digits := 15
Digits := 15
Digits = 15

==> d
d
2^(4) * 0.  2 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0
= 4

==> c := 2
c := 2
Okay.

==> d
d
2^(4) * 0.  2 -1 -2 -5 0 0 0 0 0 0 0 0 0 0 0 0
= 3

==> e
e
No such var

==> 34-
34-
Parse Error

==> notafunction(23)
notafunction(23)
Parse Error

==> exit
exit
Exiting ...


Martin Escardo
5/11/2000