PHP 8.3.4 Released!

gmp_and

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

gmp_andビット AND を計算する

説明

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

2 つの GMP 数のビット AND を計算します。

パラメータ

num1

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

num2

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

戻り値

ビット AND 演算の結果を GMP 数で返します。

例1 gmp_and() の例

<?php
$and1
= gmp_and("0xfffffffff4", "0x4");
$and2 = gmp_and("0xfffffffff4", "0x8");
echo
gmp_strval($and1) . "\n";
echo
gmp_strval($and2) . "\n";
?>

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

4
0
add a note

User Contributed Notes

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