首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::isinf

Defined in header <cmath>

?

?

bool isinf( float arg );

(1)

(since C++11)

bool isinf( double arg );

(2)

(since C++11)

bool isinf( long double arg );

(3)

(since C++11)

bool isinf( Integral arg );

(4)

(since C++11)

1-3%29确定给定的浮点数arg是一个正的或负的无穷大。

4%29一组重载或接受from任何论点积分型等效于%282%29%28的参数转换为double29%。

参数

arg

-

floating point value

返回值

true如果arg是无限的,false否则。

二次

代码语言:javascript
复制
#include <iostream>
#include <cmath>
#include <cfloat>
 
int main()
{
    std::cout << std::boolalpha
              << "isinf(NaN) = " << std::isinf(NAN) << '\n'
              << "isinf(Inf) = " << std::isinf(INFINITY) << '\n'
              << "isinf(0.0) = " << std::isinf(0.0) << '\n'
              << "isinf(exp(800)) = " << std::isinf(std::exp(800)) << '\n'
              << "isinf(DBL_MIN/2.0) = " << std::isinf(DBL_MIN/2.0) << '\n';
}

二次

产出:

二次

代码语言:javascript
复制
isinf(NaN) = false
isinf(Inf) = true
isinf(0.0) = false
isinf(exp(800)) = true
isinf(DBL_MIN/2.0) = false

二次

另见

fpclassify (C++11)

categorizes the given floating point value (function)

isfinite (C++11)

checks if the given number has finite value (function)

isnan (C++11)

checks if the given number is NaN (function)

isnormal (C++11)

checks if the given number is normal (function)

c ISINF文件

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com