-
-
Save tts7en/5e3777985d68685bafcc78467ffba95d to your computer and use it in GitHub Desktop.
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
const ZERO = 0; | |
const ONE = 1; | |
const TWO = 2; | |
/** | |
* Checks if a's state satisfies a certain requirement so that the | |
* caller function can understand what's happening with a and | |
* process accordingly. | |
*/ | |
function checkA(a) { | |
const isInt = int(a) == a; | |
const checkDiv = (a >> ONE) == ONE; | |
const checkMod = (a % TWO) == ZERO; | |
If (isInt && checkDiv && checkMod) { | |
return a == a; | |
} else { | |
return a != a; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment