Significant figures in the decimal module

前端 未结 6 1707
花落未央
花落未央 2020-12-20 22:40

So I\'ve decided to try to solve my physics homework by writing some python scripts to solve problems for me. One problem that I\'m running into is that significant figures

6条回答
  •  再見小時候
    2020-12-20 23:22

    What's wrong with floating point?

    >>> "%8.2e"%  ( 1.0/3.0 )
    '3.33e-01'
    

    It was designed for scientific-style calculations with a limited number of significant digits.

提交回复
热议问题