gmp_sub

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

gmp_sub数値の減算

説明

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

num1 から num2 を引いた結果を返します。

パラメータ

num1

引かれる数。

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

num2

num1 から引く数。

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

戻り値

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

例1 gmp_sub() の例

<?php
$sub
= gmp_sub("281474976710656", "4294967296"); // 2^48 - 2^32
echo gmp_strval($sub) . "\n";
?>

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

281470681743360

add a note

User Contributed Notes

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