c语言中limit 用法,C++ limits头文件的用法(numeric_limits)

digits10返回目标类型在十进制下可以表示的最大位数

epsilon返回目标数据类型能表示的最逼近1的正数和1的差的绝对值

has_denorm测试目标类型是不是可以非规范化表示示

has_denorm_loss测试所有类型是不是能测出因为非规范化而造成的精度损失(不是因为结果本身的不精确)

has_infinity测试目标类型是不是能表示无限(比如被0除,或者其他一些情况)

has_quiet_NaN检查目标类型是不是支持安静类型的NaN

has_signaling_NaN检查目标类型是不是支持信号类型的NaN

infinity检查目标类型的无限类型(如果支持无限表示)

is_bounded检查目标类型的取值是否有限

is_exact测试目标类型的计算结果是不是不会造成舍入误差(比如float是0)

is_iec559测试目标类型是不是符合IEC559标准

is_integer测试目标类型是不是可以用整型来表示(比如char是1,float是0)

is_moduloTests

if a type has a modulo representation.

is_signed测试目标类型是否是带符号的

is_specialized测试目标类型是不是在numeric_limits.模板类中有特殊定义

max返回可取的有限最大值

max_exponentReturns

the maximum positive integral exponent that the floating-point type can represent as a finite value when a base of radix is raised to that power.

max_exponent10Returns

the maximum positive integral exponent that the floating-point type can represent as a finite value when a base of ten is raised to that power.

min返回可取的最小值(规范化)

min_exponentReturns

the maximum negative integral exponent that the floating-point type can represent as a finite value when a base of radix is raised to that power.

min_exponent10Returns

the maximum negative integral exponent that the floating-point type can represent as a finite value when a base of ten is raised to that power.

quiet_NaN返回目标类型的安静NAN的表示

radixReturns

the integral base, referred to as radix, used for the representation of a type.

round_error返回目标类型的最大可能的舍入误差

round_styleReturns

a value that describes the various methods that an implementation can choose for rounding a floating-point value to an integer value.

signaling_NaN返回目标类型关于信号NAN的表示

tinyness_before测试目标类型是不是能测定出微小的舍入误差

trapsTests

whether trapping that reports on arithmetic exceptions is implemented for a type.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值