Facebook Page Twitter Page LinkedIn Page
× Java Tutorial Java Advanced Java Resources

The Java Math IEEEremainder() method is used to compute the remainder operation on two arguments as prescribed by the IEEE 754 standard. In special cases it returns the following:

  • 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 x, double y)


x Specify the dividend.
y Specify the divisor.

Return Value

Returns the remainder when x is divided by y.




In the below example, IEEEremainder() method is used to calculate the remainder operation on two given arguments.

public class MyClass {
 public static void main(String[] args) {
  System.out.println(Math.IEEEremainder(10.0, 3.0)); 
  System.out.println(Math.IEEEremainder(50.0, 15.0)); 
  System.out.println(Math.IEEEremainder(60.8, 18.1));     

The output of the above code will be:


❮ Java Math Methods