#include <iostream>
#include <limits>
#include <cmath>
int main() {
// Infinity
if (std::numeric_limits<float>::has_infinity) {
float pos_inf = std::numeric_limits<float>::infinity();
float neg_inf = -std::numeric_limits<float>::infinity();
std::cout << "Positive infinity: " << pos_inf << std::endl;
std::cout << "Negative infinity: " << neg_inf << std::endl;
}
// NaN (Not a Number)
if (std::numeric_limits<double>::has_quiet_NaN) {
double nan = std::numeric_limits<double>::quiet_NaN();
std::cout << "NaN: " << nan << std::endl;
std::cout << "Is NaN: " << std::isnan(nan) << std::endl;
}
// Checking if a type is integer
std::cout << "Is int integer: " << std::numeric_limits<int>::is_integer << std::endl;
std::cout << "Is float integer: " << std::numeric_limits<float>::is_integer << std::endl;
return 0;
}