在Python中算重要的数字吗? [英] Counting significant figures in Python?

查看:91
本文介绍了在Python中算重要的数字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python中是否有一种方法可以计算double/float/etc等中的有效数字?我没有找到一种简单的方法来实现此目的,但我希望它会在库中.

Is there a way in Python to count the significant figures in a double/float/etc? I'm not seeing an easy way to do this, but I'd expect it to be in the library.

谢谢.

推荐答案

否.重要的数字没什么大不了的,并且在计算机语言中获得的支持也很少.进行实际计算的人员需要误差条,误差条具有更高的精度-实际测量结果说的非常精确,例如这是0.11±0.03mm",而不是说不那么精确的陈述是这是0.1 mm"或这是0.11 mm". ",即使您的不精确性实际上并没有降到10的幂,这也使您选择10的幂.

No. Significant digits are just not that big a deal and get little support in computer languages. People doing real computations need error bars, which have far more precision — real measurements say very exact things like "this is 0.11 ± 0.03mm" instead of saying either of the less exact statements "this is 0.1 mm" or "this is 0.11 mm" which makes you choose a power of ten even if your inexactness does not actually fall at a power of ten.

这篇关于在Python中算重要的数字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆