PHP 8.3.4 Released!

gmp_jacobi

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

gmp_jacobiヤコビ記号

説明

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

num1 および num2» ヤコビ記号 を計算します。num2 は正の奇数である必要があります。

パラメータ

num1

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

num2

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

正の奇数でなければなりません。

戻り値

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

例1 gmp_jacobi() の例

<?php
echo gmp_jacobi("1", "3") . "\n";
echo
gmp_jacobi("2", "3") . "\n";
?>

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

1
0

参考

add a note

User Contributed Notes

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