Refactored structure and accessors for arrayed objects (at the VM level)
[panda.git] / st / LargeInteger.st
blobc5dfbb99959a3ee5ba1abd88f306cae4be4614de
3 "arithmetic"
5 LargeInteger method!
6 + aNumber
7         <primitive: 'LargeInteger_add'>
8         ^ super + aNumber!
10 LargeInteger method!
11 - aNumber
12         <primitive: 'LargeInteger_sub'>
13         ^ super + aNumber!
15 LargeInteger method!
16 * aNumber
17         <primitive: 'LargeInteger_mul'>
18         ^ super * aNumber!
20 LargeInteger method!
21 / aNumber
22         <primitive: 'LargeInteger_div'>
23         ^ super / aNumber!
25 LargeInteger method!
26 // aNumber
27      <primitive: 'LargeInteger_div'>
28         ^ super // aNumber!
30 LargeInteger method!
31 \\ aNumber
32         <primitive: 'LargeInteger_mod'>
33         ^ super / aNumber!
36 "comparing"
38 LargeInteger method!
39 < aNumber
40      <primitive: 'LargeInteger_lt'>
41          ^ super < aNumber!
43 LargeInteger method!
44 > aNumber
45      <primitive: 'LargeInteger_gt'>
46          ^ super > aNumber!
48 LargeInteger method!
49 <= aNumber
50      <primitive: 'LargeInteger_le'>
51          ^ super <= aNumber!
53 LargeInteger method!
54 >= aNumber
55      <primitive: 'LargeInteger_ge'>
56          ^ super >= aNumber!
58 LargeInteger method!
59 = aNumber
60      <primitive: 'LargeInteger_eq'>
61          ^ super = aNumber!
63 LargeInteger method!
64 ~= aNumber
65      <primitive: 'LargeInteger_ne'>
66          ^ super ~= aNumber!
69 "bit-wise operations"
71 LargeInteger method!
72 bitOr: aNumber
73      <primitive: 'LargeInteger_bitOr'>
74          ^ super bitOr: aNumber!
76 LargeInteger method!
77 bitAnd: aNumber
78      <primitive: 'LargeInteger_bitAnd'>
79          ^ super bitAnd: aNumber!
81 LargeInteger method!
82 bitXor: aNumber
83      <primitive: 'LargeInteger_bitAnd'>
84          ^ super bitXor: aNumber!
86 LargeInteger method!
87 bitShift: aNumber
88      <primitive: 'LargeInteger_bitShift'>
89          ^ super bitShift: aNumber!
92 "coercion"
94 LargeInteger method!
95 asFloat
96         <primitive: 'LargeInteger_asFloat'>
97         self primitiveFailed!
99 LargeInteger method!
100 asLargeInteger
101     ^ self!
103 LargeInteger method!
104 asInteger
105     ^ self!
107 LargeInteger method!
108 generality
109     ^ 20!
111 LargeInteger method!
112 zero
113     ^ 0 asLargeInteger!
115 LargeInteger method!
116 unity
117     ^ 1 asLargeInteger!
119 LargeInteger method!
120 coerce: aNumber
121     ^ aNumber asLargeInteger!
124 "printing"
126 LargeInteger method!
127 printStringRadix: anInteger
128         <primitive: 'LargeInteger_printString'>
129         anInteger isSmallInteger
130                 ifFalse: [ self error: 'expected a small integer' ]!