示例#1
0
 /**
  * This method returns the numerically lowest value.
  *
  * @access public
  * @static
  * @param ITrit\Type $x                                     the left operand
  * @param ITrit\Type $y                                     the right operand
  * @return ITrit\Type                                       the minimum value
  */
 public static function min(ITrit\Type $x, ITrit\Type $y) : ITrit\Type
 {
     return ITrit\Module::compare($x, $y)->unbox() <= 0 ? $x : $y;
 }
示例#2
0
 /**
  * This method tests the "min" method.
  *
  * @dataProvider data_min
  */
 public function test_min(array $provided, array $expected)
 {
     $p0 = ITrit\Module::min(ITrit\Type::box($provided[0]), ITrit\Type::box($provided[1]));
     $e0 = $expected[0];
     $this->assertInstanceOf('\\Saber\\Data\\ITrit\\Type', $p0);
     $this->assertSame($e0, $p0->unbox());
 }