File: expr.stat

package info (click to toggle)
pspp 0.3.0-7
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,288 kB
  • ctags: 4,679
  • sloc: ansic: 57,209; sh: 2,874; makefile: 405; sed: 93; perl: 18
file content (65 lines) | stat: -rw-r--r-- 1,265 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
title 'Test optimization of constant expressions'.

remark EOF
----------------------------------------------------------------------
Testing ability of stat to optimize constant expressions.
stat must have been compiled with debugging enabled in order to
run these tests.
----------------------------------------------------------------------
EOF
eval 1+2+3+(4*5).
eval (4-2+6.323)*(0/4-1)*(1-3+abs(-9.78)).
eval 3**(2**(8/2*3/4)).

* Truth tables. 
eval 0 and 0.
eval 0 and 1.
eval 1 and 0.
eval 1 and 1.

eval 0 or 0.
eval 0 or 1.
eval 1 or 0.
eval 1 or 1.

eval not 0.
eval not 1.

eval (1 gt 2) and (2 gt 1).
eval (7/8+1 lt 2) or (2-1/6 lt 1).
eval not (7 ne 6).

eval -(7/8).
eval abs(-6.5).
eval arcos(1.0).
eval arcos(sqrt(2)/2).
eval arsin(sqrt(2)/2).
eval artan(0).
eval artan(1.0).
eval cos(3.141592654/4).
eval cos(3.141592654/6).
eval exp(1).
eval exp(-1).
eval lg10(10).
eval lg10(128.910).
eval ln(2.71828182846).
eval ln(50).
eval mod10(128.910).
eval rnd(128.9).
eval rnd(-128.9).
eval rnd(128.1).
eval rnd(-128.1).
eval rnd(128).
eval rnd(-128).
eval rnd(128.5).
eval rnd(-128.5).
eval sin(2*3.141592654).
eval sin(3.141592654/6).
eval tan(0).
eval tan(3.141592654/8).
eval trunc(3.141592654).
eval trunc(-9.99).

eval 'x'.
eval concat('x','y').