Last active
January 23, 2024 13:32
-
-
Save ILightThings/c46a609a9957eccd35195d01f9fa267f to your computer and use it in GitHub Desktop.
Get the next biggest rounded number
This file contains hidden or 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
| # Useful for padding buffers | |
| # Useful in C | |
| Size_Of_Target = 189 | |
| Round_Number = 12 | |
| target = Size_Of_Target + Round_Number - (Size_Of_Target % Round_Number) | |
| print(target) | |
| #189 + 12 = 201 | |
| #189 % 12 = 9 | |
| #201 - 9 = 192 | |
| #Result: 192 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment