Ejemplo n.º 1
0
 /**
  * This method compares the operands for order.
  *
  * @access public
  * @static
  * @param ITrit\Type $x                                     the left operand
  * @param ITrit\Type $y                                     the right operand
  * @return ITrit\Type                                       the order as to whether the left
  *                                                          operand is less than, equals to,
  *                                                          or greater than the right operand
  */
 public static function compare(ITrit\Type $x, ITrit\Type $y) : ITrit\Type
 {
     $__x = $x->unbox();
     $__y = $y->unbox();
     if ($__x < $__y) {
         return ITrit\Type::negative();
     } else {
         if ($__x == $__y) {
             return ITrit\Type::zero();
         } else {
             // ($__x > $__y)
             return ITrit\Type::positive();
         }
     }
 }