BigInt implementation #81

Merged
pklimai merged 3 commits from big-int into dev 2020-04-26 20:08:32 +03:00
2 changed files with 179 additions and 60 deletions
Showing only changes of commit 19d1459a55 - Show all commits

View File

@ -1,6 +1,8 @@
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
package scientifik.kmath.operations
import kotlin.math.log2
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
import kotlin.math.max
import kotlin.math.min
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
import kotlin.math.sign
/*
@ -27,7 +29,6 @@ object KBigIntegerRing: Ring<KBigInteger> {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
operator fun String.unaryPlus(): KBigInteger = KBigInteger(this)!!
operator fun String.unaryMinus(): KBigInteger = -KBigInteger(this)!!
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
@ -161,7 +162,7 @@ class KBigInteger(sign: Int = 0, magnitude: Magnitude = Magnitude(0)):
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return result
}
internal fun divideMagnitudeByUInt(mag: Magnitude, x: UInt): Magnitude {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
private fun divideMagnitudeByUInt(mag: Magnitude, x: UInt): Magnitude {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val resultLength: Int = mag.size
val result = Magnitude(resultLength)
var carry: ULong = 0UL
@ -174,39 +175,6 @@ class KBigInteger(sign: Int = 0, magnitude: Magnitude = Magnitude(0)):
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return result
}
internal fun divideMagnitudes(mag1_: Magnitude, mag2: Magnitude): Magnitude {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val mag1 = ULongArray(mag1_.size) { mag1_[it].toULong() }
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val resultLength: Int = mag1.size - mag2.size + 1
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val result = LongArray(resultLength)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
for (i in mag1.size - 1 downTo mag2.size - 1) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val div: ULong = mag1[i] / mag2[mag2.size - 1]
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
result[i - mag2.size + 1] = div.toLong()
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
for (j in mag2.indices) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
mag1[i - j] -= mag2[mag2.size - 1 - j] * div
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (i > 0) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
mag1[i - 1] += (mag1[i] shl BASE_SIZE)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val normalizedResult = Magnitude(resultLength)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
var carry = 0L
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
for (i in result.indices) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
result[i] += carry
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (result[i] < 0L) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
normalizedResult[i] = (result[i] + (BASE + 1UL).toLong()).toUInt()
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
carry = -1
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
} else {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
normalizedResult[i] = result[i].toUInt()
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
carry = 0
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return normalizedResult
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
override fun compareTo(other: KBigInteger): Int {
@ -287,12 +255,100 @@ class KBigInteger(sign: Int = 0, magnitude: Magnitude = Magnitude(0)):
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return KBigInteger(this.sign * other.sign, divideMagnitudeByUInt(this.magnitude, kotlin.math.abs(other).toUInt()))
}
operator fun div(other: KBigInteger): KBigInteger {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return when {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
this < other -> ZERO
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
this == other -> ONE
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
else -> KBigInteger(this.sign * other.sign, divideMagnitudes(this.magnitude, other.magnitude))
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
private fun division(other: KBigInteger): Pair<KBigInteger, KBigInteger> {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
// Long division algorithm:
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
// https://en.wikipedia.org/wiki/Division_algorithm#Integer_division_(unsigned)_with_remainder
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
// TODO: Implement more effective algorithm
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
var q: KBigInteger = ZERO
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
var r: KBigInteger = ZERO
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val bitSize = (BASE_SIZE * (this.magnitude.size - 1) + log2(this.magnitude.last().toFloat() + 1)).toInt()
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
for (i in bitSize downTo 0) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
r = r shl 1
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
r = r or ((abs(this) shr i) and ONE)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (r >= abs(other)) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
r -= abs(other)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
q += (ONE shl i)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return Pair(KBigInteger(this.sign * other.sign, q.magnitude), r)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
operator fun div(other: KBigInteger): KBigInteger {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return this.division(other).first
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
infix fun shl(i: Int): KBigInteger {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (this == ZERO) return ZERO
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (i == 0) return this
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val fullShifts = i / BASE_SIZE + 1
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val relShift = i % BASE_SIZE
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val shiftLeft = {x: UInt -> if (relShift >= 32) 0U else x shl relShift}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val shiftRight = {x: UInt -> if (BASE_SIZE - relShift >= 32) 0U else x shr (BASE_SIZE - relShift)}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val newMagnitude: Magnitude = Magnitude(this.magnitude.size + fullShifts)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
for (j in this.magnitude.indices) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
newMagnitude[j + fullShifts - 1] = shiftLeft(this.magnitude[j])
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (j != 0) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
newMagnitude[j + fullShifts - 1] = newMagnitude[j + fullShifts - 1] or shiftRight(this.magnitude[j - 1])
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
newMagnitude[this.magnitude.size + fullShifts - 1] = shiftRight(this.magnitude.last())
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return KBigInteger(this.sign, newMagnitude)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
infix fun shr(i: Int): KBigInteger {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (this == ZERO) return ZERO
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (i == 0) return this
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val fullShifts = i / BASE_SIZE
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val relShift = i % BASE_SIZE
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val shiftRight = {x: UInt -> if (relShift >= 32) 0U else x shr relShift}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val shiftLeft = {x: UInt -> if (BASE_SIZE - relShift >= 32) 0U else x shl (BASE_SIZE - relShift)}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (this.magnitude.size - fullShifts <= 0) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return ZERO
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val newMagnitude: Magnitude = Magnitude(this.magnitude.size - fullShifts)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
for (j in fullShifts until this.magnitude.size) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
newMagnitude[j - fullShifts] = shiftRight(this.magnitude[j])
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (j != this.magnitude.size - 1) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
newMagnitude[j - fullShifts] = newMagnitude[j - fullShifts] or shiftLeft(this.magnitude[j + 1])
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return KBigInteger(this.sign, newMagnitude)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
infix fun or(other: KBigInteger): KBigInteger {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (this == ZERO) return other;
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (other == ZERO) return this;
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val resSize = max(this.magnitude.size, other.magnitude.size)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val newMagnitude: Magnitude = Magnitude(resSize)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
for (i in 0 until resSize) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (i < this.magnitude.size) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
newMagnitude[i] = newMagnitude[i] or this.magnitude[i]
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if (i < other.magnitude.size) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
newMagnitude[i] = newMagnitude[i] or other.magnitude[i]
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return KBigInteger(1, newMagnitude)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
infix fun and(other: KBigInteger): KBigInteger {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
if ((this == ZERO) or (other == ZERO)) return ZERO;
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val resSize = min(this.magnitude.size, other.magnitude.size)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
val newMagnitude: Magnitude = Magnitude(resSize)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
for (i in 0 until resSize) {
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
newMagnitude[i] = this.magnitude[i] and other.magnitude[i]
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
return KBigInteger(1, newMagnitude)
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
}
operator fun rem(other: Int): Int {

altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:45:31 +03:00 (Migrated from github.com)
Review

Why use whole Int for simple three way flag? Could it be replaced by boolean? Enum?

Why use whole `Int` for simple three way flag? Could it be replaced by boolean? Enum?
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:47:11 +03:00 (Migrated from github.com)
Review

Move to private constructor and move parameter checks to auxiliary builders.

Move to private constructor and move parameter checks to auxiliary builders.
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 17:56:20 +03:00 (Migrated from github.com)
Review

Companion should be last declaration in the class

Companion should be last declaration in the class
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:02 +03:00 (Migrated from github.com)
Review

Also all internal values must be marked as private

Also all internal values must be marked as private
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:03:38 +03:00 (Migrated from github.com)
Review

should be virtual if it is not performance-critical

should be virtual if it is not performance-critical
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:15:40 +03:00 (Migrated from github.com)
Review

It does not make sense to make it RingElement since all operations are already class members.

It does not make sense to make it RingElement since all operations are already class members.
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
altavir commented 2020-04-09 18:17:05 +03:00 (Migrated from github.com)
Review

Refactor to String.toBigInteger()

Refactor to String.toBigInteger()
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
pklimai commented 2020-04-15 20:37:04 +03:00 (Migrated from github.com)
Review

Now using Byte for that

Now using Byte for that
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
Shimuuar commented 2020-04-15 22:25:06 +03:00 (Migrated from github.com)
Review

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?

Even byte is wasteful. Especially considering that my eat whole word due to alignment. Why not use 2-complement?
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)
pklimai commented 2020-04-15 22:42:14 +03:00 (Migrated from github.com)
Review

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

This may be a good idea, but I suspect (performance) problems with 2-complement will appear when we try to operate with numbers of different length. At least the classical Java BigInt implementation stores magnitude and signum separately (http://developer.classpath.org/doc/java/math/BigInteger-source.html)

View File

@ -244,6 +244,62 @@ class KBigIntegerOperationsTest {
assertEquals(prod, res)
}
@Test
fun test_shr_20() {
val x = KBigInteger(20)
assertEquals(KBigInteger(10), x shr 1)
}
@Test
fun test_shl_20() {
val x = KBigInteger(20)
assertEquals(KBigInteger(40), x shl 1)
}
@Test
fun test_shl_1_0() {
assertEquals(KBigInteger.ONE, KBigInteger.ONE shl 0)
}
@Test
fun test_shl_1_32() {
assertEquals(KBigInteger(0x100000000UL), KBigInteger.ONE shl 32)
}
@Test
fun test_shl_1_33() {
assertEquals(KBigInteger(0x200000000UL), KBigInteger.ONE shl 33)
}
@Test
fun test_shr_1_33_33() {
assertEquals(KBigInteger.ONE, (KBigInteger.ONE shl 33) shr 33)
}
@Test
fun test_shr_1_32() {
assertEquals(KBigInteger.ZERO, KBigInteger.ONE shr 32)
}
@Test
fun test_and_123_456() {
val x = KBigInteger(123)
val y = KBigInteger(456)
assertEquals(KBigInteger(72), x and y)
}
@Test
fun test_or_123_456() {
val x = KBigInteger(123)
val y = KBigInteger(456)
assertEquals(KBigInteger(507), x or y)
}
@Test
fun test_asd() {
assertEquals(KBigInteger.ONE, KBigInteger.ZERO or ((KBigInteger(20) shr 4) and KBigInteger.ONE))
}
@Test
fun test_square_0x11223344U_0xad2ffffdU_0x17eU() {
val num = KBigInteger(-1, uintArrayOf(0x11223344U, 0xad2ffffdU, 0x17eU ))
@ -307,6 +363,12 @@ class KBigIntegerOperationsTest {
assertEquals(div, res)
}
@Test
fun testBigDivision_0xfffffffeabcdef01UL_0xfffffffeabc() {
val res = KBigInteger(0xfffffffeabcdef01UL) / KBigInteger(0xfffffffeabc)
assertEquals(res, KBigInteger(0x100000))
}
@Test
fun testBigDivision_0xfffffffe00000001_0xffffffff() {
val x = KBigInteger(0xfffffffe00000001UL)
@ -379,7 +441,7 @@ class KBigIntegerOperationsTest {
val exp = KBigInteger(2)
val mod = KBigInteger(0xfffffffeabcUL)
val res = KBigInteger(0x6deec7895faUL)
val res = KBigInteger(0xc2253cde01)
return assertEquals(res, x.modPow(exp, mod))
}
@ -434,26 +496,9 @@ class KBigIntegerConversionsTest {
}
}
@kotlin.ExperimentalUnsignedTypes
class DivisionTests {
// TODO
@Test
fun test_0xfffffffeabcdef01UL_0xfffffffeabc() {
val res = KBigInteger(0xfffffffeabcdef01UL) / KBigInteger(0xfffffffeabc)
assertEquals(res, KBigInteger(0x100000))
}
// println(KBigInteger(+1, uintArrayOf(1000U, 1000U, 1000U)) / KBigInteger(0xfffffffeabc) )
// >>> hex((1000 + 1000*2**32 + 1000*2**64)/ 0xfffffffeabc) == 0x3e800000L
// println(KBigInteger(+1, KBigInteger.divideMagnitudeByUInt(uintArrayOf(1000U, 1000U, 1000U),456789U)))
// 0x8f789719813969L
}
class KBigIntegerRingTest {
@Test
fun testSum() {
fun testKBigIntegerRingSum() {
val res = KBigIntegerRing {
KBigInteger(1_000L) * KBigInteger(1_000L)
}
@ -461,7 +506,7 @@ class KBigIntegerRingTest {
}
@Test
fun test_sum_100_000_000__100_000_000() {
fun testKBigIntegerRingSum_100_000_000__100_000_000() {
KBigIntegerRing {
val sum = +"100_000_000" + +"100_000_000"
assertEquals(sum, KBigInteger("200_000_000"))
@ -476,5 +521,23 @@ class KBigIntegerRingTest {
}
}
@Test
fun test_div_big_1() {
KBigIntegerRing {
val res = +"1_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000" /
+"555_000_444_000_333_000_222_000_111_000_999_001"
assertEquals(res, +"1801800360360432432518919022699")
}
}
@Test
fun test_rem_big_1() {
KBigIntegerRing {
val res = +"1_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000_000" %
+"555_000_444_000_333_000_222_000_111_000_999_001"
assertEquals(res, +"324121220440768000291647788404676301")
}
}
}