Created
September 8, 2020 16:49
-
-
Save tieubinhco/6eb1c09a6230e04aa3e691a8d8033ff1 to your computer and use it in GitHub Desktop.
sign function in C++
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
int sign_of(float x) | |
{ | |
if (x >= 0) | |
return 1; | |
else | |
return -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment