コード例 #1
0
ファイル: ModuleTest.php プロジェクト: bluesnowman/fphp-saber
 /**
  * This method tests the "pow" method.
  *
  * @dataProvider data_pow
  */
 public function test_pow(array $provided, array $expected)
 {
     $p0 = IInt32\Module::pow(IInt32\Type::box($provided[0]), IInt32\Type::box($provided[1]));
     $e0 = $expected[0];
     $this->assertInstanceOf('\\Saber\\Data\\IInt32\\Type', $p0);
     $this->assertEquals($e0, $p0->unbox());
 }
コード例 #2
0
ファイル: Module.php プロジェクト: bluesnowman/fphp-saber
 /**
  * This method returns the ratio raised to the power of the specified exponent.
  *
  * @access public
  * @static
  * @param IRatio\Type $x                                    the operand
  * @param IInt32\Type $exponent                             the exponent to be raised by
  * @return IRatio\Type                                      the result
  */
 public static function pow(IRatio\Type $x, IInt32\Type $exponent) : IRatio\Type
 {
     return IRatio\Type::make(IInt32\Module::pow($x->numerator(), $exponent), IInt32\Module::pow($x->denominator(), $exponent));
 }