128或96位整数类型? [英] 128 or 96 bit integer types?
问题描述
是否有大型整数类型的内置或第三方支持,例如大小为96或128位的
?我需要如此大尺寸的精度
问题(纳秒)。谢谢。
2007年7月27日星期五16:45:05 +0000,Robert Dailey写道:
< blockquote class =post_quotes>
是否有大型整数类型的内置或第三方支持,例如大小为96或128位的
?
是的,只需使用整数值。如果它不适合'int`它
被提升为`long`。 Python`long` \ ns仅限于可用的
内存。
在[59]中:2 ** 128
Out [59]:340282366920938463463374607431768211456L
Ciao,
Marc''BlackJack''Rintsch
Robert Dailey写道:
是否有大型整数类型的内置或第三方支持,例如
为96或128位尺寸?我需要如此大尺寸的精度
问题(纳秒)。谢谢。
>> SECOND = 10 ** 9
年份= 365 * 24 * 60 * 60
2 ** 128 /秒/年
10790283070806014188970L
你在测量什么?宇宙的时代?在纳秒内?
:-)
彼得
7月27日,下午1:27,Peter Otten< __ pete ... @ web.dewrote:
Robert Dailey写道:
是否有大型整数类型的内置或第三方支持,例如
为96或128位大小?我需要如此大尺寸的精度
问题(纳秒)。谢谢。
> SECOND = 10 ** 9
年份= 365 * 24 * 60 * 60
2 ** 128 /秒/年
10790283070806014188970L
你在测量什么?宇宙的时代?在纳秒内?
:-)
嗯,2 ** 96只有2512308552583年。
>
Peter
Hi,
Is there build-in or third party support for large integer types, such
as 96 or 128 bits in size? I require such large sizes for precision
issues (nanoseconds). Thanks.
On Fri, 27 Jul 2007 16:45:05 +0000, Robert Dailey wrote:
Is there build-in or third party support for large integer types, such
as 96 or 128 bits in size?Yes there is, just use integer values. If it don''t fit into an `int` it
gets promoted to a `long`. Python `long`\s are only bounded by available
memory.
In [59]: 2**128
Out[59]: 340282366920938463463374607431768211456L
Ciao,
Marc ''BlackJack'' Rintsch
Robert Dailey wrote:
Is there build-in or third party support for large integer types, such
as 96 or 128 bits in size? I require such large sizes for precision
issues (nanoseconds). Thanks.
>>SECOND = 10**9
YEAR = 365*24*60*60
2**128/SECOND/YEAR
10790283070806014188970L
What are you measuring? The age of the universe? In nanoseconds?
:-)
Peter
On Jul 27, 1:27 pm, Peter Otten <__pete...@web.dewrote:Robert Dailey wrote:Is there build-in or third party support for large integer types, such
as 96 or 128 bits in size? I require such large sizes for precision
issues (nanoseconds). Thanks.>SECOND = 10**9
YEAR = 365*24*60*60
2**128/SECOND/YEAR
10790283070806014188970L
What are you measuring? The age of the universe? In nanoseconds?
:-)Well, 2**96 would only be 2512308552583 years.
>
Peter
这篇关于128或96位整数类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!