C# Double Inequality

Description

Double Inequality returns a value that indicates whether two specified Double values are not equal.

Syntax

Double.Inequality has the following syntax.


public static bool operator !=(
  double left,
  double right
)

Parameters

Double.Inequality has the following parameters.

  • left - The first value to compare.
  • right - The second value to compare.

Returns

Double.Inequality method returns true if left and right are not equal; otherwise, false.

Example

The following code shows how to use Double.Inequality operator.


public class MainClass{
   public static void Main(){
     double d1 = 1.2;
     double d2 = 1.3;
     //  ww w. ja  va  2 s.  c  o  m
     System.Console.WriteLine(d1 != d2);
   
   }

}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version