1
How to calculate the rest with "%" from two Biginteger numbers?
1
How to calculate the rest with "%" from two Biginteger numbers?
1
Just use the method of mod()
class BigInteger
.
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
class Ideone {
public static void main (String[] args) throws java.lang.Exception {
BigInteger bi1, bi2, bi3;
bi1 = new BigInteger("-100");
bi2 = new BigInteger("3");
bi3 = bi1.mod(bi2);
System.out.println(bi3);
}
}
Behold working in the ideone. And in the repl it.. Also put on the Github for future reference.
Browser other questions tagged java mathematics bigint
You are not signed in. Login or sign up in order to post.