isinf() in C++

isinf(): This function is available in the file cmath. This function checks if the given number is infinity (either positive or negative). This function returns a non-zero value (true) if x is an infinity, and zero (false) otherwise.

Parameters: One parameter is required for this function.

arg: A floating-point number.

Syntax:

isinf(arg)

For Example:

isinf(10.45) = > It return false (0).

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{

    double X = 10.45;
    cout << isinf(X<< "\n";

    return 0;
}


No comments:

Post a Comment