python中可以表示的最小数字是多少? [英] What is the smallest number which can be represented in python?

查看:348
本文介绍了python中可以表示的最小数字是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在python中可以表示的最小数字是多少?

What is the smallest number which can be represented in python?

我看过像2.05623357236e-296一样小,但是可以再小的吗?

I have seen as small as 2.05623357236e-296 but can there be any smaller?

推荐答案

签出 sys.float_info

>>> import sys
>>> sys.float_info 
sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1)

来自文档

min       DBL_MIN      minimum positive normalized float 
min_exp   DBL_MIN_EXP  minimum integer e such that radix**(e-1) is a normalized float

在我的系统上,它被称为min=2.2250738585072014e-308

On my system it is mentioned as min=2.2250738585072014e-308

这篇关于python中可以表示的最小数字是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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