Python Basic - sys.float_info

前言

一种关于浮点数据类型的顺序结构的信息。它包含低级别的精确度和内部特征的信息,这些值 用于在在C语言中的头文件float.h对应浮点型常量数据。

sys.float_info 运行信息

import sys
print(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)

"""

sys float_info的宏

attributefloat.h macroexplanation
epsilonDBL_EPSILONdifference between 1 and the least value greater than 1 that is representable as a float
digDBL_DIGmaximum number of decimal digits that can be faithfully represented in a float; see below
mant_digDBL_MANT_DIGfloat precision: the number of base-radix digits in the significand of a float
maxDBL_MAXmaximum representable finite float
max_expDBL_MAX_EXPmaximum integer e such that radix**(e-1) is a representable finite float
max_10_expDBL_MAX_10_EXPmaximum integer e such that 10**e is in the range of representable finite floats
minDBL_MINminimum positive normalized float
min_expDBL_MIN_EXPminimum integer e such that radix**(e-1) is a normalized float
min_10_expDBL_MIN_10_EXPminimum integer e such that 10**e is a normalized float
radixFLT_RADIXradix of exponent representation
roundsFLT_ROUNDSinteger constant representing the rounding mode used for arithmetic operations. This reflects the value of the system FLT_ROUNDS macro at interpreter startup time. See section 5.2.4.2.2 of the C99 standard for an explanation of the possible values and their meanings.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值