<= Operator
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

<= Operator (C# Reference)

All numeric and enumeration types define a "less than or equal" relational operator (<=) that returns true if the first operand is less than or equal to the second, false otherwise.

User-defined types can overload the <= operator. For more information, see operator. If <= is overloaded, >= must also be overloaded. Operations on integral types are generally allowed on enumeration.

// cs_operator_less_than_or_equal.cs
using System;
class MainClass
    static void Main() 
        Console.WriteLine(1 <= 1.1);
        Console.WriteLine(1.1 <= 1.1);


© 2015 Microsoft