HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

gmp_and

Description

The gmp_and of GMP for PHP bitwise AND.

Syntax

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

Parameters

num1

A GMP object, an int or a numeric string.

num2

A GMP object, an int or a numeric string.

Return

Returns a GMP number representing the bitwise AND comparison.

Examples

1 · num1 num2 · GMP

<?

$num1 = 0b100;
$num2 = 0b110;

$num1 = gmp_init($num1);
$num2 = gmp_init($num2);

$return = gmp_and($num1, $num2);

var_dump($return);

$num = $return;
$base = 2;

$gmp_strval = gmp_strval($num, $base);

echo $gmp_strval;
object(GMP)#3 (1) {
  ["num"]=>
  string(1) "4"
}
100

2 · num1 num2 · int

<?

$num1 = 0b100;
$num2 = 0b110;

$return = gmp_and($num1, $num2);

var_dump($return);

$num = $return;
$base = 2;

$gmp_strval = gmp_strval($num, $base);

echo $gmp_strval;
object(GMP)#1 (1) {
  ["num"]=>
  string(1) "4"
}
100

3 · num1 num2 · string

<?

$num1 = "0b100";
$num2 = "0b110";

$return = gmp_and($num1, $num2);

var_dump($return);

$num = $return;
$base = 2;

$gmp_strval = gmp_strval($num, $base);

echo $gmp_strval;
<!doctype html>
<html>
<head>
    <title>PHP</title>
    <style>
        html, a
        {
            background-color: rgb(255 0 255 / 0.1);
        }
        a
        {
            color: purple;
            transition-duration: 1s;

            &:hover
            {
                background-color: rgb(0 0 0 / 0.1);
                color: black;
                text-decoration-color: transparent;
            }
        }
    </style>
</head>
<body>
    <a href="/php/">PHP</a>
    <script>
        function myfunction(myparameter)
        {
            const mytarget = myparameter.target;
            const mystyle = mytarget.style;
            mystyle.position = "absolute";
            mystyle.left = `${Math.random() * (window.innerWidth - mytarget.offsetWidth)}px`;
            mystyle.top = `${Math.random() * (window.innerHeight - mytarget.offsetHeight)}px`;
        }
        document.querySelector("a").addEventListener("mouseout", myfunction);
    </script>
</body>
</html>