Description Of BigInteger: modInverse(BigInteger m)
The java.math.BigInteger.modInverse(BigInteger m) returns a BigInteger whose value is (this-1 mod m)BigInteger.modInverse(BigInteger m) BigInteger.modInverse(BigInteger m) method returns this-1 mod m
Code Example Java BigInteger
import java.math.BigInteger; public class BigIntegerExam { public static void main(String[] args) { BigInteger bi1 = new BigInteger("7"); BigInteger bi2 = new BigInteger("40"); System.out.println(bi1.mod(bi2)); // output 7 System.out.println(bi1.modInverse(bi2)); // output 23 System.out.println(bi2.mod(bi1)); // output 5 System.out.println(bi2.modInverse(bi1)); // output 3 } }
ไม่มีความคิดเห็น :
แสดงความคิดเห็น