大数? [英] Large Numbers?
问题描述
我可以在PHP中使用的最大数字(整数?)
是多少?
例如,我有这个数字:
1082655076035
这实际上是我需要的日期
与其他日期比较。
我只是想知道一个人是否比另一个人更好
但是好像没有工作的b $ b。
我可以尝试将它转换为日期对象,如果
这是唯一的方法...
谢谢,
Andrew
What is the largest number (integer?)
that I can work with in PHP?
For example, I have this number:
1082655076035
This is actually a date that I need to
compare with another date.
I was just going to see if one was greater
than the other but it doesn''t seem to be
working.
I can try to convert it to a date object if
that is the only way to do it...
Thanks,
Andrew
推荐答案
Andrew写道:
我可以在PHP中使用的最大数字(整数?)
例如,我有这个数字:
1082655076035
这实际上是一个我需要和另一个约会比较的日期。
我只是想看看哪一个比另一个更好
但是它似乎不是
我可以尝试将它转换为日期对象,如果
这是唯一的方法...
谢谢,
Andrew
What is the largest number (integer?)
that I can work with in PHP?
For example, I have this number:
1082655076035
This is actually a date that I need to
compare with another date.
I was just going to see if one was greater
than the other but it doesn''t seem to be
working.
I can try to convert it to a date object if
that is the only way to do it...
Thanks,
Andrew
根据几乎所有平台的定义,INTEGER是32位(4字节)或
最大值2亿你的号码是> 1亿美元。
来自:
http://www.php.net/manual/en/language.types.integer.php
" ;整数的大小取决于平台,尽管大约20亿的最大值是大约20亿美元(通常是32位签名)。 PHP
不支持无符号整数。
你想使用浮动
http://www.php.net/manual/en/language.types.float。 php
"浮动的大小取决于平台,但最大值为
~1.8e308,精度约为14十进制数字是一个常见值
(即64位IEEE格式)。
Michael Austin。
By definition on almost all platforms INTEGER is 32 bits (4 bytes) or a
maximum of 2Billion your number is > 1Trillion.
from:
http://www.php.net/manual/en/language.types.integer.php
"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). PHP
does not support unsigned integers."
you want to use float
http://www.php.net/manual/en/language.types.float.php
"The size of a float is platform-dependent, although a maximum of
~1.8e308 with a precision of roughly 14 decimal digits is a common value
(that''s 64 bit IEEE format)."
Michael Austin.
Andrew写道:
Andrew wrote:
我可以在PHP中使用的最大数字(整数?)
是什么?
>例如,我有这个号码:
1082655076035
这实际上是我需要与其他日期进行比较的日期。
我可以尝试将它转换为日期对象如果
这是唯一的方法...
谢谢,
安德鲁
What is the largest number (integer?)
that I can work with in PHP?
For example, I have this number:
1082655076035
This is actually a date that I need to
compare with another date.
I was just going to see if one was greater
than the other but it doesn''t seem to be
working.
I can try to convert it to a date object if
that is the only way to do it...
Thanks,
Andrew
....忘记提及大多数系统现在使用64位日期/时间...
如果你认为我错了2 ^ 32是2147483648 ,整数是
签名 - 换句话说它是2 ^ 31而第32位是+/-。
2 ^ 32是4294967296 >
2 ^ 64是18446744073709551616
差别很大......
迈克尔。
.... forgot to mention that most systems now use 64 bits for date/time...
and if you are thinking I was wrong that 2^32 is 2147483648, integer is
signed - in otherwords it is 2^31 and the 32nd bit is for +/-.
2^32 is 4294967296
2^64 is 18446744073709551616
Big difference...
Michael.
在文章< UU ***************** @newssvr23.news.prodigy.com> ,迈克尔·奥斯汀写道:
In article <UU*****************@newssvr23.news.prodigy.com> , Michael Austin wrote:
如果你认为我错了2 ^ 32是2147483648,整数是
签名 - 换句话说它是2 ^ 31而第32位是+ /-.
and if you are thinking I was wrong that 2^32 is 2147483648, integer is
signed - in otherwords it is 2^31 and the 32nd bit is for +/-.
我认为你在这里弄错了。
补充符号,如第一个(2 ^ 32)/ 2代表一个正整数
和最后一个(2 ^ 32)/ 2表示负整数。
-
Tim Van Wassenhove < http://home.mysth.be/~timvw>
I think you are mistaken here.
Complement notation, as in the first (2^32)/2 represent a positive integer
and the last (2^32)/2 represent a negative integer.
--
Tim Van Wassenhove <http://home.mysth.be/~timvw>
这篇关于大数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!