biginteger.remainder()
时间: 2024-05-08 22:16:49 浏览: 60
The `BigInteger.remainder()` method is a Java method that calculates the remainder of dividing one `BigInteger` by another `BigInteger`.
Syntax:
```java
public BigInteger remainder(BigInteger divisor)
```
Parameters:
- `divisor`: The `BigInteger` divisor to divide by.
Return Value:
- A `BigInteger` representing the remainder of dividing the current `BigInteger` by the specified `BigInteger` divisor.
Example:
```java
import java.math.BigInteger;
public class BigIntegerExample {
public static void main(String[] args) {
BigInteger num1 = new BigInteger("100");
BigInteger num2 = new BigInteger("7");
BigInteger remainder = num1.remainder(num2);
System.out.println("The remainder of " + num1 + " divided by " + num2 + " is " + remainder);
}
}
```
Output:
```
The remainder of 100 divided by 7 is 2
```
阅读全文