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