1
- package kbignumbers.biginteger
1
+ package org.komputing. kbignumbers.biginteger
2
2
3
3
/* *
4
4
* Immutable arbitrary-precision integers. All operations behave as if
@@ -73,7 +73,7 @@ package kbignumbers.biginteger
73
73
* -2<sup>{@code Integer.MAX_VALUE}</sup> (exclusive) to
74
74
* +2<sup>{@code Integer.MAX_VALUE}</sup> (exclusive).
75
75
*/
76
- actual class BigInteger (val value : java.math.BigInteger ) : Number(), Comparable<kbignumbers.biginteger. BigInteger> {
76
+ actual class BigInteger (val value : java.math.BigInteger ) : Number(), Comparable<BigInteger> {
77
77
78
78
/* *
79
79
* Translates the sign-magnitude representation of a BigInteger into a BigInteger.
@@ -97,7 +97,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
97
97
* @return {@code this + value}
98
98
*/
99
99
actual fun add (value : BigInteger ): BigInteger {
100
- return BigInteger (this .value.add(value.value))
100
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.add(value.value))
101
101
}
102
102
103
103
/* *
@@ -107,7 +107,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
107
107
* @return {@code this - val}
108
108
*/
109
109
actual fun subtract (value : BigInteger ): BigInteger {
110
- return BigInteger (this .value.subtract(value.value))
110
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.subtract(value.value))
111
111
}
112
112
113
113
/* *
@@ -117,7 +117,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
117
117
* @return {@code this * val}
118
118
*/
119
119
actual fun multiply (value : BigInteger ): BigInteger {
120
- return BigInteger (this .value.multiply(value.value))
120
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.multiply(value.value))
121
121
}
122
122
123
123
/* *
@@ -128,7 +128,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
128
128
* @throws ArithmeticException if {@code val} is zero.
129
129
*/
130
130
actual fun divide (value : BigInteger ): BigInteger {
131
- return BigInteger (this .value.divide(value.value))
131
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.divide(value.value))
132
132
}
133
133
134
134
/* *
@@ -142,7 +142,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
142
142
* @see remainder
143
143
*/
144
144
actual fun mod (m : BigInteger ): BigInteger {
145
- return BigInteger (this .value.mod(m.value))
145
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.mod(m.value))
146
146
}
147
147
148
148
/* *
@@ -154,7 +154,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
154
154
* @throws ArithmeticException if {@code val} is zero.
155
155
*/
156
156
actual fun remainder (value : BigInteger ): BigInteger {
157
- return BigInteger (this .value.remainder(value.value))
157
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.remainder(value.value))
158
158
}
159
159
160
160
/* *
@@ -166,7 +166,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
166
166
* @return {@code this ^ val}
167
167
*/
168
168
actual fun xor (value : BigInteger ): BigInteger {
169
- return BigInteger (this .value.xor(value.value))
169
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.xor(value.value))
170
170
}
171
171
172
172
/* *
@@ -178,7 +178,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
178
178
* @return {@code this & val}
179
179
*/
180
180
actual fun and (value : BigInteger ): BigInteger {
181
- return BigInteger (this .value.and (value.value))
181
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.and (value.value))
182
182
}
183
183
184
184
/* *
@@ -192,7 +192,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
192
192
* @see shiftRight
193
193
*/
194
194
actual fun shiftLeft (n : Int ): BigInteger {
195
- return BigInteger (this .value.shiftLeft(n))
195
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.shiftLeft(n))
196
196
}
197
197
198
198
/* *
@@ -206,7 +206,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
206
206
* @see shiftLeft
207
207
*/
208
208
actual fun shiftRight (n : Int ): BigInteger {
209
- return BigInteger (this .value.shiftRight(n))
209
+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.shiftRight(n))
210
210
}
211
211
212
212
/* *
@@ -301,11 +301,14 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
301
301
}
302
302
303
303
actual companion object {
304
- actual val ZERO : BigInteger = BigInteger (java.math.BigInteger .ZERO )
305
- actual val ONE : BigInteger = BigInteger (java.math.BigInteger .ONE )
306
- actual val TEN : BigInteger = BigInteger (java.math.BigInteger .TEN )
304
+ actual val ZERO : BigInteger =
305
+ org.komputing.kbignumbers.biginteger.BigInteger (java.math.BigInteger .ZERO )
306
+ actual val ONE : BigInteger =
307
+ org.komputing.kbignumbers.biginteger.BigInteger (java.math.BigInteger .ONE )
308
+ actual val TEN : BigInteger =
309
+ org.komputing.kbignumbers.biginteger.BigInteger (java.math.BigInteger .TEN )
307
310
actual fun valueOf (value : Long ): BigInteger {
308
- return BigInteger (java.math.BigInteger .valueOf(value))
311
+ return org.komputing.kbignumbers.biginteger. BigInteger (java.math.BigInteger .valueOf(value))
309
312
}
310
313
}
311
314
}
0 commit comments