示例#1
0
 /**
  * This method evaluates whether the left operand is NOT identical to the right operand.
  *
  * @access public
  * @static
  * @param ITrit\Type $x                                     the left operand
  * @param Core\Type $y                                      the right operand
  * @return IBool\Type                                       whether the left operand is NOT identical
  *                                                          to the right operand
  */
 public static function ni(ITrit\Type $x, Core\Type $y) : IBool\Type
 {
     // !==
     return IBool\Module::not(ITrit\Module::id($x, $y));
 }
示例#2
0
 /**
  * This method evaluates whether the left operand is NOT identical to the right operand.
  *
  * @access public
  * @static
  * @param IOption\Type $xs                                  the left operand
  * @param Core\Type $ys                                     the right operand
  * @return IBool\Type                                       whether the left operand is NOT identical
  *                                                          to the right operand
  */
 public static function ni(IOption\Type $xs, Core\Type $ys) : IBool\Type
 {
     // !==
     return IBool\Module::not(IOption\Module::id($xs, $ys));
 }
示例#3
0
 /**
  * This method evaluates whether the left operand is NOT identical to the right operand.
  *
  * @access public
  * @static
  * @param Throwable\Runtime\Exception $x                    the left operand
  * @param Core\Type $y                                      the right operand
  * @return IBool\Type                                        whether the left operand is NOT identical
  *                                                          to the right operand
  */
 public static function ni(Throwable\Runtime\Exception $x, Core\Type $y)
 {
     // !==
     return IBool\Module::not(Throwable\Runtime\Exception\Module::id($x, $y));
 }
示例#4
0
 /**
  * This method tests the "xor_" method.
  */
 public function test_xor_()
 {
     $x = IBool\Type::true();
     $y = IBool\Type::false();
     $z = IBool\Module::xor_($x, $y);
     $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $z);
     $this->assertSame(true, $z->unbox());
     $z = IBool\Module::xor_($x, $x);
     $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $z);
     $this->assertSame(false, $z->unbox());
     $z = IBool\Module::xor_($y, $x);
     $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $z);
     $this->assertSame(true, $z->unbox());
     $z = IBool\Module::xor_($y, $y);
     $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $z);
     $this->assertSame(false, $z->unbox());
 }
示例#5
0
 /**
  * This method returns the numerically lowest value.
  *
  * @access public
  * @static
  * @param IBool\Type $x                                     the left operand
  * @param IBool\Type $y                                     the right operand
  * @return IBool\Type                                       the minimum value
  */
 public static function min(IBool\Type $x, IBool\Type $y) : IBool\Type
 {
     return IBool\Module::compare($x, $y)->unbox() <= 0 ? $x : $y;
 }
示例#6
0
 /**
  * This method returns whether the ratio is a whole number.
  *
  * @access public
  * @static
  * @param IRatio\Type $x                                    the ratio to be evaluated
  * @return IBool\Type                                       whether the ratio is a whole
  *                                                          number
  */
 public static function isInteger(IRatio\Type $x) : IBool\Type
 {
     return IBool\Module::or_(IInt32\Module::eq($x->numerator(), IInt32\Type::zero()), IInt32\Module::eq($x->denominator(), IInt32\Type::one()));
 }