C# Math IEEERemainder
Description
Math IEEERemainder
returns the remainder resulting
from the division of a specified number by another specified number.
Syntax
Math.IEEERemainder
has the following syntax.
public static double IEEERemainder(
double x,
double y
)
Parameters
Math.IEEERemainder
has the following parameters.
x
- A dividend.y
- A divisor.
Returns
Math.IEEERemainder
method returns A number equal to x - (y Q), where Q is the quotient of x / y rounded to the nearest
integer (if x / y falls halfway between two integers, the even integer is returned).
If x - (y Q) is zero, the value +0 is returned if x is positive, or -0 if x is negative.
If y = 0, NaN is returned.
Example
The following example contrasts the remainder returned by the IEEERemainder method with the remainder returned by the modulus division operator.
using System;/*from ww w . jav a 2 s . c om*/
public class Example
{
public static void Main()
{
Console.WriteLine(Math.IEEERemainder(1, 2));
}
}
The code above generates the following result.