Greater Than (>) and Less Than (<) : Comparison Operators « Language « Flash / Flex / ActionScript






Greater Than (>) and Less Than (<)

 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){


        var x:int = 0;
        
        var a:int = -1;
        var b:int = 0;
        var c:int = 1;
        
        trace(x <= a); // Displays: false
        trace(x >= a); // Displays: true
        trace(x <= b); // Displays: true
        trace(x >= b); // Displays: true
        trace(x <= c); // Displays: true
        trace(x >= c); // Displays: false

    }
  }
}

        








Related examples in the same category

1.Comparison Operators in Actionscript
2.Strict equality
3.Number Comparison
4.Checking Equality or Comparing Values
5.The logical inequality operator (!=) returns false if two values are equal and true if they aren't.
6.Use the < and > operators to check if one value is less than or greater than another value:
7.Use the <= and >= operators to check if one value is less than or equal to, or greater than or equal to, another value:
8.When comparing primitive datatypes, ActionScript compares them by value.
9.When you compare composite datatypes, ActionScript compares them by reference.
10.Two composite items are equal only if they both refer to the identical object
11.Equality (==)
12.Not Equal To (!=)