-
Notifications
You must be signed in to change notification settings - Fork 42
ModularBigInteger Usage Overview
Ugljesa Jovanovic edited this page May 11, 2019
·
1 revision
Modular arithmetic operations are supported only between integers with the same modulo.
First define the modulo you are going to use by getting an instance of the creator, and than use that creator to create instances of modular integers
val creator = ModularBigInteger.creatorForModulo(100)
val modularBigInteger = creator.fromLong(150)
println("ModularBigInteger: ${modularBigInteger.toStringWithModulo()}")
----- Output -----
ModularBigInteger: 50 mod 100
Otherwise behavior is similar to normal integers