Home » Java Math.IEEEremainder() Method with Examples

Java Math.IEEEremainder() Method with Examples

by Online Tutorials Library

Java Math.IEEEremainder() method

The java.lang.Math.IEEEremainder() is used to compute the remainder operation on two arguments as prescribed by the IEEE 754 standard. The remainder value is mathematically equal to a-b × n, where n is the mathematical integer closest to the exact mathematical value of the quotient a/b.

If two integers are equally closed to a/b then n is the integer that is even.

Syntax

Parameter

Return

  • If the remainder of two arguments is zero, its sign is the same as the sign of the first argument.
  • If the first argument is infinite, this method will return NaN.
  • If the second argument is positive or negative zero, this method will return NaN.
  • If either of the argument is NaN, this method will return NaN.
  • If the first argument is finite and second argument is infinity, this method will return the first argument value.

Example 1

Test it Now

Output:

0.7000000000000064  

Example 2

Test it Now

Output:

-0.0  

Example 3

Test it Now

Output:

NaN  

Example 4

Test it Now

Output:

NaN  

Example 5

Test it Now

Output:

NaN  

Example 6

Test it Now

Output:

27.13  

Next TopicJava Math

You may also like