gpt4 book ai didi

php - php是否支持64位ieee float

转载 作者:可可西里 更新时间:2023-11-01 14:02:49 25 4
gpt4 key购买 nike

我对这个话题做了深入的研究。但这个问题还不清楚。谁能帮我解决这个问题。 http://www.php.net/manual/en/language.types.float.php此链接没有正确描述任何内容。

最佳答案

是的。


来自 PHP 手册..

The size of an integer is platform-dependent, although a maximum valueof about two billion is the usual value (that's 32 bits signed).64-bit platforms usually have a maximum value of about 9E18. PHP doesnot support unsigned integers. Integer size can be determined usingthe constant PHP_INT_SIZE, and maximum value using the constantPHP_INT_MAX since PHP 4.4.0 and PHP 5.0.5.

还有..

If the float is beyond the boundaries of integer (usually +/- 2.15e+9= 2^31 on 32-bit platforms and +/- 9.22e+18 = 2^63 on 64-bit platforms), the result is undefined, since the float doesn't haveenough precision to give an exact integer result. No warning, not evena notice will be issued when this happens!

从 PHP 手册到第 3 方站点的内部链接摘录...

PHP is dynamically typed and will often convert implicitly betweenstrings and floating-point numbers (which are platform-dependant, buttypically IEEE 64 bit values). To force a value to floating-point,evaluate it in a numerical context: $foo = 0 + "10.5";

但是如果你想玩弄 float 和精度,你需要使用 GMP功能。

关于php - php是否支持64位ieee float,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23081133/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com