Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-01-19 21:52:59 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-01-19 21:54:07 +0300
commit075def8fbda709e9db9086e9f2800a56103eb35d (patch)
treec706af87879cafc2d784a627cd6243f0d6f4a724 /source/blender/blenlib/intern/math_base_inline.c
parentfa91b43e8cbe55179bfb783be4371e8bc50e9d74 (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.c4
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.
*