public static BigInteger modInverse ( BigInteger val , BigInteger modulus ) { if ( modulus . signum ( ) <= 0 ) { throw new ArithmeticException ( "modulus must be positive" ) ; } return INSTANCE . get ( ) . modInverseImpl ( val , modulus ) ; }
Calculate val^ - 1 % modulus .