コード例 #1
0
ファイル: ModuleTest.php プロジェクト: bluesnowman/fphp-saber
 /**
  * This method tests the "isNegative" method.
  *
  * @dataProvider data_isNegative
  */
 public function test_isNegative(array $provided, array $expected)
 {
     $p0 = IFloat\Module::isNegative(IFloat\Type::box($provided[0]));
     $e0 = $expected[0];
     $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $p0);
     $this->assertSame($e0, $p0->unbox());
 }
コード例 #2
0
ファイル: Module.php プロジェクト: bluesnowman/fphp-saber
 /**
  * This method returns the numerically lowest value.
  *
  * @access public
  * @static
  * @param IFloat\Type $x                                    the left operand
  * @param IFloat\Type $y                                    the right operand
  * @return IFloat\Type                                      the minimum value
  */
 public static function min(IFloat\Type $x, IFloat\Type $y) : IFloat\Type
 {
     return IFloat\Module::compare($x, $y)->unbox() <= 0 ? $x : $y;
 }