1
0

Test boolean.

This commit is contained in:
Captain ALM 2022-08-14 22:17:56 +01:00
parent 4eb93057a9
commit f3a5a7668a
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

View File

@ -2,15 +2,12 @@
int main()
{
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';
return 0;
if(-1)
std::cout << "-1 is true\n";
if(2)
std::cout << "2 is true\n";
if(1)
std::cout << "1 is true\n";
if(!0)
std::cout << "0 is false\n";
}