推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
abubun
V2EX  ›  Python

为什么 Python 2.7.13 计算 63.0*60.0/2.1 结果为 1800.0 ?

  •  
  •   abubun · May 28, 2018 · 4722 views
    This topic created in 3092 days ago, the information mentioned may be changed or developed.
    Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 63*60/2.1
    1800.0
    17 replies  •  2018-05-28 20:24:25 +08:00
    firedsxist0
    firedsxist0
    May 28, 2018
    1
    我用笔算了一下...1800..不对吗- -
    swuzjb
    swuzjb
    May 28, 2018
    2
    用计算器算了下 没问题啊
    weyou
    weyou
    May 28, 2018 via Android
    3
    那你觉得是多少?
    ZavierXu
    ZavierXu
    May 28, 2018
    4
    难道楼主生活在一个和我们不同的数学空间里……
    proudzhu
    proudzhu
    May 28, 2018 via iPhone
    5
    楼主可能想看到 u
    proudzhu
    proudzhu
    May 28, 2018 via iPhone
    6
    楼主可能想看到 1800.000001 啥的
    wlwood
    wlwood
    May 28, 2018
    7
    有人对物理规律产生怀疑,lz 直接对数学产生了怀疑。

    楼主莫不是,归零者?(逃。。。。
    shuizhengqi
    shuizhengqi
    May 28, 2018
    8
    自己本来就是浮点数运算,还想自动给你转整型?
    princelai
    princelai
    May 28, 2018❤️1
    9
    63*(60/2.1)
    1799.9999999999998

    你是想要这个结果吗?
    BBCCBB
    BBCCBB
    May 28, 2018
    10
    楼主睡迷糊了?
    xpresslink
    xpresslink
    May 28, 2018
    11
    楼主问了一下非常深奥的问题,难度近似于为什么 1+1=2
    est
    est
    May 28, 2018❤️3
    12
    1800.0

    LZ 想说为啥最后一个 0 是全角的?
    Shura
    Shura
    May 28, 2018
    13
    你看想要这样的结果?
    >>> 63*60//2.1
    1799.0
    wtxagxy
    wtxagxy
    May 28, 2018
    14
    lz 请给出你的答案
    UnknownR
    UnknownR
    May 28, 2018
    15
    你是想输出 1800 吗
    BlackCat02
    BlackCat02
    May 28, 2018
    16
    为什么 Python 2.7.13 计算 63.0*60.0/2.1 结果为 180 0.0
    这样就合理了(滑稽)
    580a388da131
    580a388da131
    May 28, 2018
    17
    整数和浮点数的区别
    3/5 结果 0
    3.0/5 结果 0.6
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   991 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 19:42 · PVG 03:42 · LAX 11:42 · JFK 14:42
    ♥ Do have faith in what you're doing.