Created
April 10, 2018 07:17
-
-
Save inog/a493850b4a9f2dbcb7095c293199595f to your computer and use it in GitHub Desktop.
divide 2 ints and always round up the result
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
public static int roundUp(int dividend, int divisor) { | |
return (dividend + divisor - 1) / divisor; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment