source:
tests/.expect/rational.txt
@
8e64cb4
Last change on this file since 8e64cb4 was d30804a, checked in by , 3 years ago | |
---|---|
|
|
File size: 603 bytes |
Rev | Line | |
---|---|---|
[f621a148] | 1 | constructor |
[d30804a] | 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 | ||
[f621a148] | 19 | arithmetic |
[d30804a] | 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 | ||
[6c6455f] | 36 | conversion |
37 | 0.75 | |
38 | 0.142857142857143 | |
39 | 3.14159292035398 | |
40 | 3/4 | |
41 | 1/7 | |
42 | 355/113 | |
[d30804a] | 43 | |
[f621a148] | 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.