Java Math IEEEremainder() Method Last Updated : 12 May, 2025 Comments Improve Suggest changes Like Article Like Report The IEEEremainder() method in Java is a part of the java.lang.Math class. This method calculates the remainder operation on two arguments based on the IEEE 754 standard, which is different from the regular modulus "%" operator.Usage of IEEEremainder() MethodThe method calculates the remainder using the below formula:remainder = dividend - (divisor × n)The remainder value is mathematically equal to dividend - (divisor × n), where n is the mathematical integer closest to the exact mathematical value of the quotient dividend / divisor, and if two mathematical integers are equally close to dividend / divisor, then n is the integer that is even.Syntax of IEEEremainder() Methodpublic static double Math.IEEEremainder(double dividend, double divisor)Parameters:dividend: The number to be divided.divisor: The number by which the dividend is divided.Returns: It returns the IEEE 754 remainder. If the result is zero, it has the same sign as the dividend.For Special Cases: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.Examples of Java Math IEEEremainder() MethodExample 1: In this example, we will see the working of IEEEremainder() method. Java // Java program to demonstrate // Math.IEEEremainder() with standard input import java.lang.Math; public class Geeks { public static void main(String[] args) { double dividend = 31.34; double divisor = 2.2; System.out.println("Result: " + Math.IEEEremainder(dividend, divisor)); } } OutputResult: 0.5399999999999974 Example 2: In this example, we will see how IEEEremainder() method handles negative values and zero. Java // Java program demonstrating how IEEEremainder // handles negative values and zero import java.lang.Math; public class Geeks { public static void main(String[] args) { double x = -21.0; double y = 7.0; System.out.println("Result: " + Math.IEEEremainder(x, y)); } } OutputResult: -0.0 Example 3: In this example, we will see how IEEEremainder() method handles edge cases. Java // Java program to show results with // infinity and NaN inputs import java.lang.Math; public class Geeks { public static void main(String[] args) { double inf = Double.POSITIVE_INFINITY; double zero = 0.0; double finite = -2.34; double large = Double.POSITIVE_INFINITY; System.out.println("Infinity / 0 = " + Math.IEEEremainder(inf, zero)); System.out.println("Finite / Infinity = " + Math.IEEEremainder(finite, large)); } } OutputInfinity / 0 = NaN Finite / Infinity = -2.34 Comment More infoAdvertise with us Next Article StrictMath IEEEremainder() Method in Java N Niraj_Pandey Follow Improve Article Tags : Java Java-lang package java-math Practice Tags : Java Similar Reads Java Math IEEEremainder() method with Examples The IEEEremainder() method in Java is a part of the java.lang.Math class. This method calculates the remainder operation on two arguments based on the IEEE 754 standard, which is different from the regular modulus "%" operator.Usage of IEEEremainder() MethodThe method calculates the remainder using 2 min read StrictMath IEEEremainder() Method in Java The Java.lang.StrictMath.IEEEremainder() is an inbuilt method of StrictMath class which is used to perform the remainder operation on given two arguments as prescribed by the IEEE 754 standard. The remainder value is mathematically equal to num1 â num2 * rem , where rem is the mathematical integer c 2 min read java.math class and its methods | Set 3 java.math class and its methods | Set 1 java.math class and its methods | Set 2 ceil() : java.math.ceil(double a) method returns the smallest possible value which is either greater or equal to the argument passed. The returned value is a mathematical integer.Special Case : Result is same, if the ret 5 min read Method class isSynthetic() method in Java java.lang.reflectMethod class help us to get information of a single method on a class or interface. This class also provides access to the methods of classes and invoke them at runtime. isSynthetic() method of Method class: This function checks whether Method Object is a synthetic construct or not. 3 min read List add(E ele) method in Java with Examples The add(E ele) method of List interface in Java is used to insert the specified element to the end of the current list. Syntax: public boolean add(E ele) Parameter: This method accepts a single parameter ele which represents the element to be inserted at the end of this list. Return Value: The funct 2 min read MessageDigest getProvider() method in Java with Examples The method getProvider() of java.security.MessageDigest class is used to get the provider of this message digest. Syntax: public final Provider getProvider() Return Value: This method returns the provider of this MessageDigest. Below are the examples to illustrate the getProvider() method: Example 1 2 min read KeyFactory getProvider() method in Java with Examples The getProvider() method of java.security.KeyFactory class is used to get the name of the Provider's object used by this KeyFactory instance. Syntax: public final Provider getProvider() Parameters: This method does not takes any parameters. Return Value: This method returns the name of the Provider' 2 min read Java 8 | BigInteger divideAndRemainder() method with Examples java.math.BigInteger.divideAndRemainder(BigInteger val) was introduced in Java 8. This method returns an array of two BigInteger after applying division operation between the BigInteger calling this method and the BigInteger passed as a parameter to the other method. Here, First BigInteger of the ar 3 min read Java Signature getProvider() method with Examples The getProvider() method of java.security.Signature class is used to return the provider of this signature object. Syntax: public final Provider getProvider() Return Value: This method returns the provider of this signature object Below are the examples to illustrate the getProvider() method: Exampl 2 min read BigDecimal divideAndRemainder() Method in Java with Examples The java.math.BigDecimal.divideAndRemainder(BigDecimal divisor) is used to calculate both quotient and remainder of two BigDecimals. If both the integer quotient and remainder are needed then this method is faster than using the divideToIntegralValue() and remainder() methods separately because the 4 min read Like