Introduction
C++ is a computer language that supports both imperative and object-oriented programming. Middle-level programming language is another name for it. Bjarne Stroustrup has been working on it at Bell Labs since 1979. It was published for the first time in 1985. It is a free-form programming language that is compiled, general-purpose, statically typed, and case sensitive. Learning C++ not only makes the basics of programming much stronger but also opens the path to various career opportunities.
A professional C++ programmer must be familiar with the various inbuilt functions that the language provides. In this blog, we'll look at the isinf() function in C++, its syntax, how it works, and what its return result is.
Also see, Literals in C, Fibonacci Series in C++
isinf() function
isinf() is a built-in function in C++ that resides in the header file of MATH that checks if the variable handed in is infinite or not, regardless of whether the value is negative or positive infinity. The function returns a non-zero result (true) if the number is infinite, and zero if it is not (false). If the number is NAN, the method will likewise return 0.
Syntax:
bool isinf(float n);
bool isinf(double n);
bool isinf(long double n);
One important characteristic of the isinf function is that it accepts only floating-point numbers.
The function returns a boolean value, with 0 indicating false (not infinity) and 1 indicating true (infinite).
Also Read - C++ Interview Questions