相关疑难解决方法(0)

Python如何管理int和long?

有没有人知道Python如何管理内部int和long类型?

  • 它是否动态选择正确的类型?
  • int的限制是什么?
  • 我使用的是Python 2.6,与以前的版本有什么不同?

我该如何理解下面的代码?

>>> print type(65535)
<type 'int'>
>>> print type(65536*65536)
<type 'long'>
Run Code Online (Sandbox Code Playgroud)

更新:

>>> print type(0x7fffffff)
<type 'int'>
>>> print type(0x80000000)
<type 'long'>
Run Code Online (Sandbox Code Playgroud)

python integer

106
推荐指数
4
解决办法
19万
查看次数

标签 统计

integer ×1

python ×1