|
BcMath\Number::powmod任意精度数値のべき乗の、指定した数値による剰余 説明
public BcMath\Number BcMath\Number::powmod(BcMath\Numberstringint
$exponent , BcMath\Numberstringint $modulus , intnull $scale = null )
パラメータ
戻り値計算結果を新しい BcMath\Number オブジェクトとして返します。
計算結果オブジェクトの BcMath\Number::scale が自動的に設定される場合、常に エラー / 例外このメソッドは、以下の場合に ValueError をスローします:
このメソッドは、 例例1 BcMath\Number::powmod で
上の例の出力は以下となります。 object(BcMath\Number)#3 (2) { ["value"]=> string(1) "2" ["scale"]=> int(0) } object(BcMath\Number)#4 (2) { ["value"]=> string(2) "-2" ["scale"]=> int(0) } object(BcMath\Number)#2 (2) { ["value"]=> string(1) "1" ["scale"]=> int(0) } object(BcMath\Number)#5 (2) { ["value"]=> string(2) "-1" ["scale"]=> int(0) } 例2 BcMath\Number::powmod で
上の例の出力は以下となります。 object(BcMath\Number)#3 (2) { ["value"]=> string(3) "2.0" ["scale"]=> int(1) } object(BcMath\Number)#4 (2) { ["value"]=> string(5) "-2.00" ["scale"]=> int(2) } object(BcMath\Number)#2 (2) { ["value"]=> string(5) "1.000" ["scale"]=> int(3) } object(BcMath\Number)#5 (2) { ["value"]=> string(7) "-1.0000" ["scale"]=> int(4) } 参考
|