diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-01-19 21:52:59 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-01-19 21:54:07 +0300 |
commit | 075def8fbda709e9db9086e9f2800a56103eb35d (patch) | |
tree | c706af87879cafc2d784a627cd6243f0d6f4a724 /source/blender/blenlib/intern/math_base_inline.c | |
parent | fa91b43e8cbe55179bfb783be4371e8bc50e9d74 (diff) |
Util function to determine number of digits from an integer
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index 9202efce7b4..a0c13e14e72 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -397,6 +397,10 @@ MINLINE int integer_digits_d(const double d) return (d == 0.0) ? 0 : (int)floor(log10(fabs(d))) + 1; } +MINLINE int integer_digits_i(const int i) +{ + return (int)log10(i) + 1; +} /* Internal helpers for SSE2 implementation. * |