Last change
on this file since 9fba8e6 was
d30804a,
checked in by Peter A. Buhr <pabuhr@…>, 3 years ago
|
augment rational test and expected output after rational changes
|
-
Property mode set to
100644
|
File size:
603 bytes
|
Line | |
---|
1 | constructor |
---|
2 | a : 3/1 b : 4/1 c : 0/1 d : 0/1 e : 1/1 |
---|
3 | a : 1/2 b : 5/7 |
---|
4 | a : 2/3 b : -3/2 |
---|
5 | a : -2/3 b : 3/2 |
---|
6 | |
---|
7 | comparison |
---|
8 | a : -2/1 b : -3/2 |
---|
9 | a == 0 : 0 |
---|
10 | a == 1 : 0 |
---|
11 | a != 0 : 1 |
---|
12 | ! a : 0 |
---|
13 | a != b : 1 |
---|
14 | a < b : 1 |
---|
15 | a <= b : 1 |
---|
16 | a > b : 0 |
---|
17 | a >= b : 0 |
---|
18 | |
---|
19 | arithmetic |
---|
20 | a : -2/1 b : -3/2 |
---|
21 | a + b : -7/2 |
---|
22 | a += b : -7/2 |
---|
23 | ++a : -5/2 |
---|
24 | a++ : -5/2 |
---|
25 | a : -3/2 |
---|
26 | a - b : 0/1 |
---|
27 | a -= b : 0/1 |
---|
28 | --a : -1/1 |
---|
29 | a-- : -1/1 |
---|
30 | a : -2/1 |
---|
31 | a * b : 3/1 |
---|
32 | a / b : 4/3 |
---|
33 | a \ 2 : 4/1 b \ 2 : 9/4 |
---|
34 | a \ -2 : 1/4 b \ -2 : 4/9 |
---|
35 | |
---|
36 | conversion |
---|
37 | 0.75 |
---|
38 | 0.142857142857143 |
---|
39 | 3.14159292035398 |
---|
40 | 3/4 |
---|
41 | 1/7 |
---|
42 | 355/113 |
---|
43 | |
---|
44 | more tests |
---|
45 | -3/2 |
---|
46 | 0 |
---|
47 | 1/2 1 1/2 |
---|
48 | 2/1 1 2/1 |
---|
49 | 0/1 |
---|
50 | 1/2 1 1/2 |
---|
51 | 2/2147483647 |
---|
52 | 5/2147483647 |
---|
53 | 2/3 4/5 |
---|
Note: See
TracBrowser
for help on using the repository browser.