Add a function to wrap percentage calculations
This should help avoid issues from integer overflow (which is technically undefined behaviour) while also allowing such issues to be addressed centrally if they still exist.
This commit is contained in:
@@ -25,6 +25,7 @@ short get_ran(short times, short min, short max);
|
||||
short max(short a,short b);
|
||||
short min(short a,short b);
|
||||
short minmax(short min,short max,short k);
|
||||
int percent(int value, int percentage);
|
||||
short gcd(short a, short b);
|
||||
sf::Time time_in_ticks(int ticks);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user