forked from bonzini/smalltalk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
intmath.ok
187 lines (129 loc) · 3.01 KB
/
intmath.ok
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
Execution begins...
returned value is 3
Execution begins...
returned value is -3
Execution begins...
returned value is 10
Execution begins...
returned value is 255
Execution begins...
returned value is 254
Execution begins...
returned value is 7
Execution begins...
returned value is -1
Execution begins...
returned value is true
Execution begins...
returned value is false
Execution begins...
returned value is false
Execution begins...
returned value is true
Execution begins...
returned value is false
Execution begins...
returned value is false
Execution begins...
returned value is true
Execution begins...
returned value is true
Execution begins...
returned value is false
Execution begins...
returned value is true
Execution begins...
returned value is false
Execution begins...
returned value is 12
Execution begins...
returned value is 4
Execution begins...
returned value is 2
Execution begins...
returned value is 4
Execution begins...
returned value is 2
Execution begins...
returned value is -3
Execution begins...
returned value is -3
Execution begins...
returned value is 0
Execution begins...
returned value is 2
Execution begins...
returned value is 0
Execution begins...
returned value is -2
Execution begins...
returned value is 3
Execution begins...
returned value is -3
Execution begins...
returned value is '1000000000000000000000000000000000000'
Execution begins...
returned value is 100
Execution begins...
returned value is '93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000'
Execution begins...
returned value is true
Execution begins...
returned value is false
Execution begins...
returned value is true
Execution begins...
returned value is false
Execution begins...
returned value is true
Execution begins...
returned value is false
Execution begins...
returned value is false
Execution begins...
returned value is false
Execution begins...
returned value is true
Execution begins...
returned value is true
Execution begins...
returned value is false
Execution begins...
returned value is true
Execution begins...
returned value is true
Execution begins...
returned value is false
Execution begins...
returned value is false
Execution begins...
returned value is true
Execution begins...
true
true
returned value is true
Execution begins...
returned value is true
Execution begins...
returned value is true
Execution begins...
returned value is true
Execution begins...
returned value is true
Execution begins...
'Shift -1 left then right and test for -1'
'Shift 1 left then right and test for 1'
'And a single bit with -1 and test for same value'
'Verify that (n bitAnd: n negated) = n'
'Verify that (n + n complemented) = -1'
'Verify that n negated = (n complemented +1)'
'LargeInteger bit logic tests passed'
returned value is true
Execution begins...
64212742967590157
1216451004088320000
returned value is Fraction new "<0>"
Execution begins...
12497
12496
returned value is 314159