Skip to content

Instantly share code, notes, and snippets.

@tieubinhco
Created September 8, 2020 16:49
Show Gist options
  • Save tieubinhco/6eb1c09a6230e04aa3e691a8d8033ff1 to your computer and use it in GitHub Desktop.
Save tieubinhco/6eb1c09a6230e04aa3e691a8d8033ff1 to your computer and use it in GitHub Desktop.
sign function in C++
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