Last active
July 30, 2017 13:25
-
-
Save OPhamster/fb6add04afcb4e375ed098b2c9075553 to your computer and use it in GitHub Desktop.
Definition to check for positive integer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check if integer is greater than zero or not | |
// this function returns true when a!=0 ie if (a<0 || a>0) | |
// this is not a good check for positive integers | |
// I realize this is not a good example - but for the sake of argument | |
bool check_if_positive(int a){ | |
return bool(a) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment