IEEEremainder(): This method is available in the Math class of Java.
Syntax:
double java.lang.Math.IEEEremainder(double f1, double f2)
This method takes two arguments of type double as its parameters. This method computes the remainder operation on two arguments as prescribed by the IEEE 754 standard. The remainder value is mathematically equal to f1 - f2 × 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.
Special cases:
1.If either the argument is NaN, or the first argument is infinite, or the second argument is positive zero or negative zero, then the result is NaN.
2. If the first argument is finite and the second argument is infinite, then the result is the same as the first argument.
Parameters: Two parameters are required for this method.
f1: the dividend.
f2: the divisor.
Returns: the remainder when f1 is divided by f2.
For Example:
Math.IEEEremainder(17,5) = > It returns 2.0
Approach
Java
public class IEEERemainder {public static void main(String[] args) {double f1 = 17, f2 = 5;System.out.println(Math.IEEEremainder(f1, f2));}}
Output:
2.0
No comments:
Post a Comment