The java.lang.Math.IEEEremainder() method computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.The remainder value is mathematically equal to f1 – f2 x n, where n is the mathematical integer closest to the exact mathematical value of the quotient f1/f2, and if two mathematical integers are equally close to f1/f2, then n is the integer that is even.
- If the remainder is zero, its sign is the same as the sign of the first argument.
- If either argument is NaN, or the first argument is infinite, or the second argument is positive zero or negative zero, then the result is NaN.
- If the first argument is finite and the second argument is infinite, then the result is the same as the first argument.
public static double IEEEremainder(double dividend, double divisor) Parameter: dividend : the dividend. divisor : the divisor. Return : This method returns the remainder when dividend is divided by divisor.
Example 1: To show working of java.lang.Math.IEEEremainder() method.
0.5399999999999974 -0.0 NaN -2.34
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.