2022-08-12 14:59:08 +01:00
|
|
|
#include <iostream>
|
2022-08-13 00:34:25 +01:00
|
|
|
|
2022-08-12 14:59:08 +01:00
|
|
|
int main()
|
|
|
|
{
|
2022-08-14 22:01:30 +01:00
|
|
|
double zero {0.0};
|
|
|
|
double posinf { 5.0 / zero }; // positive infinity
|
|
|
|
std::cout << posinf << '\n';
|
|
|
|
|
|
|
|
double neginf { -5.0 / zero }; // negative infinity
|
|
|
|
std::cout << neginf << '\n';
|
|
|
|
|
|
|
|
double nan { zero / zero }; // not a number (mathematically invalid)
|
|
|
|
std::cout << nan << '\n';
|
|
|
|
|
2022-08-13 23:29:56 +01:00
|
|
|
return 0;
|
2022-08-12 14:59:08 +01:00
|
|
|
}
|