C# Double Equality
Description
Double Equality
returns a value that indicates whether
two specified Double values are equal.
Syntax
Double.Equality
has the following syntax.
public static bool operator ==(
double left,
double right
)
Parameters
Double.Equality
has the following parameters.
left
- The first value to compare.right
- The second value to compare.
Returns
Double.Equality
method returns true if left and right are equal; otherwise, false.
Example
The following code shows how to use Double.Equality operator.
public class MainClass{
public static void Main(){
double d1 = 1.2;
double d2 = 1.3;
//from w ww .j a va2 s . co m
System.Console.WriteLine(d1 == d2);
}
}
The code above generates the following result.