[英]PHP - Need the 64bit output on a 32bit php install
When I run this: 当我运行这个:
echo ((1 << 56) | (7 << 52) | 4437313);
32bit
PHP returns: 24360257
32bit
PHP返回: 24360257
64bit
PHP returns: 103582791433958721
64bit
PHP返回: 103582791433958721
How would I go about returning the 64bit
answer on a 32bit
install of php? 我将如何在32bit
安装的php上返回64bit
答案?
I have the BC extension if that makes a difference? 我可以使用BC扩展名吗?
You cannot shift more than 32 bits on a 32 bit processor. 在32位处理器上,移位不能超过32位。
The size of an integer is platform-dependent, although a maximum value of about two billion is the usual value (that's 32 bits signed). 整数的大小取决于平台,尽管通常的最大值约为20亿(32位带符号)。 64-bit platforms usually have a maximum value of about 9E18. 64位平台的最大值通常约为9E18。 PHP does not support unsigned integers. PHP不支持无符号整数。 Integer size can be determined using the constant PHP_INT_SIZE, and maximum value using the constant PHP_INT_MAX since PHP 4.4.0 and PHP 5.0.5. 自PHP 4.4.0和PHP 5.0.5起,可以使用常数PHP_INT_SIZE确定整数大小,并使用常数PHP_INT_MAX确定最大值。
http://php.net/manual/en/language.types.integer.php http://php.net/manual/en/language.types.integer.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.