Test boolean.
This commit is contained in:
parent
4eb93057a9
commit
f3a5a7668a
19
main.cpp
19
main.cpp
@ -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";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user