Skip to content

Instantly share code, notes, and snippets.

@shinhirota
Created February 28, 2017 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinhirota/c4656d47c00ee20bb4a23af20aa71eff to your computer and use it in GitHub Desktop.
Save shinhirota/c4656d47c00ee20bb4a23af20aa71eff to your computer and use it in GitHub Desktop.
BOOL is_product_overflow(long a, long b) {
long prod = a * b;
return (prod / b != a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment