1- package kbignumbers.biginteger
1+ package org.komputing. kbignumbers.biginteger
22
33/* *
44 * Immutable arbitrary-precision integers. All operations behave as if
@@ -73,7 +73,7 @@ package kbignumbers.biginteger
7373 * -2<sup>{@code Integer.MAX_VALUE}</sup> (exclusive) to
7474 * +2<sup>{@code Integer.MAX_VALUE}</sup> (exclusive).
7575 */
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> {
7777
7878 /* *
7979 * 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<
9797 * @return {@code this + value}
9898 */
9999 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))
101101 }
102102
103103 /* *
@@ -107,7 +107,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
107107 * @return {@code this - val}
108108 */
109109 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))
111111 }
112112
113113 /* *
@@ -117,7 +117,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
117117 * @return {@code this * val}
118118 */
119119 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))
121121 }
122122
123123 /* *
@@ -128,7 +128,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
128128 * @throws ArithmeticException if {@code val} is zero.
129129 */
130130 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))
132132 }
133133
134134 /* *
@@ -142,7 +142,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
142142 * @see remainder
143143 */
144144 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))
146146 }
147147
148148 /* *
@@ -154,7 +154,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
154154 * @throws ArithmeticException if {@code val} is zero.
155155 */
156156 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))
158158 }
159159
160160 /* *
@@ -166,7 +166,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
166166 * @return {@code this ^ val}
167167 */
168168 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))
170170 }
171171
172172 /* *
@@ -178,7 +178,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
178178 * @return {@code this & val}
179179 */
180180 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))
182182 }
183183
184184 /* *
@@ -192,7 +192,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
192192 * @see shiftRight
193193 */
194194 actual fun shiftLeft (n : Int ): BigInteger {
195- return BigInteger (this .value.shiftLeft(n))
195+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.shiftLeft(n))
196196 }
197197
198198 /* *
@@ -206,7 +206,7 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
206206 * @see shiftLeft
207207 */
208208 actual fun shiftRight (n : Int ): BigInteger {
209- return BigInteger (this .value.shiftRight(n))
209+ return org.komputing.kbignumbers.biginteger. BigInteger (this .value.shiftRight(n))
210210 }
211211
212212 /* *
@@ -301,11 +301,14 @@ actual class BigInteger(val value: java.math.BigInteger) : Number(), Comparable<
301301 }
302302
303303 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 )
307310 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))
309312 }
310313 }
311314}
0 commit comments