> Operator (C# Reference)
The "greater than" relational operator
true if its first operand is greater than its second operand,
false otherwise. All numeric and enumeration types support the
> operator. For operands of the same enum type, the corresponding values of the underlying integral type are compared.
For relational operators
<=, if any of the operands is not a number (Double.NaN or Single.NaN) the result of operation is
false. That means that the
NaN value is neither greater than, less than, nor equal to any other
float) value. For more information and examples, see the Double.NaN or Single.NaN reference article.
The following example demonstrates the usage of the
Console.WriteLine(7.0 > 5.1); // output: True Console.WriteLine(5.1 > 5.1); // output: False Console.WriteLine(0.0 > 5.1); // output: False Console.WriteLine(double.NaN > 5.1); // output: False Console.WriteLine(double.NaN <= 5.1); // output: False
C# language specification
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.