BLI_math: add floor_power_of_10, ceil_power_of_10

Add utility functions to get the floor/ceiling of a float value
to the next power of 10.
This commit is contained in:
2020-11-13 16:58:14 +11:00
parent 40b2ce5ea7
commit ccf8df66fe
3 changed files with 57 additions and 0 deletions

View File

@@ -219,6 +219,9 @@ MINLINE unsigned int round_db_to_uint_clamp(double a);
int pow_i(int base, int exp);
double double_round(double x, int ndigits);
float floor_power_of_10(float f);
float ceil_power_of_10(float f);
#ifdef BLI_MATH_GCC_WARN_PRAGMA
# pragma GCC diagnostic pop
#endif