CakeFest 2024: The Official CakePHP Conference

gmp_mod

(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)

gmp_modモジュロ演算

説明

gmp_mod(GMP|int|string $num1, GMP|int|string $num2): GMP

num2 を法とした num1 を計算します。結果は常に非負であり、 num2 の符号は無視されます。

パラメータ

num1

GMP オブジェクト、整数、あるいは数値に変換可能な数値形式の文字列。

num2

法として使用する値。

GMP オブジェクト、整数、あるいは数値に変換可能な数値形式の文字列。

戻り値

GMP オブジェクトを返します。

例1 gmp_mod() の例

<?php
$mod
= gmp_mod("8", "3");
echo
gmp_strval($mod) . "\n";
?>

上の例の出力は以下となります。

2

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top