【发布时间】:2019-04-30 03:47:39
【问题描述】:
我使用的系统和PHP版本:
- 操作系统:Centos 7 x86_64
- PHP:PHP 7.2
网址:http://php.net/manual/en/function.decbin.php
代码:
<?php
$a = PHP_INT_SIZE;
$b = PHP_INT_MAX;
$c = PHP_INT_MIN;
echo "The value of \$a: ", $a . "\n";
echo "The value of \$b: ", $b . "\n";
echo "The value of \$c: ", $c . "\n\n";
echo "The binary of \$b: " . decbin($b) . "\n";
echo "The binary of \$c: " . decbin($c) . "\n";
输出:
The value of $a: 8
The value of $b: 9223372036854775807
The value of $c: -9223372036854775808
The binary of $b: 111111111111111111111111111111111111111111111111111111111111111
The binary of $c: 1000000000000000000000000000000000000000000000000000000000000000
问题:
- 二进制数最小值为64
- 最大的二进制数是63,为什么?
感谢您的回答。
【问题讨论】: