python - 大数的python除法自动上限
问题描述
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print(111111111111111111/10)
1.1111111111111112e+16
>>> print(int(111111111111111111/10))
11111111111111112
>>>
参考上面的片段,有人可以帮我理解为什么111111111111111111/10
返回11111111111111112
而不是11111111111111111
?
解决方案
使用楼层划分:
>>> 111111111111111111//10
11111111111111111
>>>
推荐阅读
- maven - 需要帮助来理解 pom.xml 中的第二行
- java - 当 pom.xml 中的依赖项数量达到某个阈值时,tomcat 失败
- asp.net-mvc - 在 asp.net mvc 中使用 nexmo 将播放音频文件添加到现有出站呼叫时发生异常“值不能为空。参数名称为值”
- css - Two column wide image in three column wide page
- google-apps-script - 将附件从 Gmail 复制到云端硬盘
- c# - 从 json URL 显示数据表中的动态数据
- performance - ES 1.X 中基于索引的搜索请求限制
- mongodb - 未找到 $match 时的 $addFields
- eclipse - Eclipse IDE:在文件正文中搜索使用文件名
- python - python使用包含模式复制文件