diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-13 08:58:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-13 09:05:46 +0300 |
commit | ccf8df66fea3650b3d43ed079f9eec4cf35e99f6 (patch) | |
tree | b0fef6285945c04849aa8a0af6f3ab032c255181 /source/blender/blenlib/BLI_math_base.h | |
parent | 40b2ce5ea73b4b7235435aa2e2ef7dc7742084a0 (diff) |
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.
Diffstat (limited to 'source/blender/blenlib/BLI_math_base.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_base.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index d2bb60717ca..0ec65999006 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -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 |