system and PHP versions
- system: Centos 64-bit
- PHP 7.2
URL: http://php.net/manual/en/func.
PHP Code:
<?php
$a = PHP_INT_SIZE;
$b = PHP_INT_MAX;
$c = PHP_INT_MIN;
echo "\$a:", $a . "\n";
echo "\$b:", $b . "\n";
echo "\$c:", $c . "\n\n";
echo "\$b:" . decbin($b) . "\n";
echo "\$c:" . decbin($c) . "\n";
output result:
$a:8
$b:9223372036854775807
$c:-9223372036854775808
$b:111111111111111111111111111111111111111111111111111111111111111
$c:1000000000000000000000000000000000000000000000000000000000000000
problem description:
- in 64-bit system, the maximum integer value is 9223372036854775807, and the minimum integer value is-9223372036854775808, The binary of the minimum value of
- is 64 bits, and the 1 of the highest bit is a negative number.
- Why is the maximum binary 63 bits? Did you omit the first 0?
Thank you for the answer