(SOC) Storage Only Commit
(ADD) Name, NameScope, Catlog, Object, String, Attribute, Char, Registry, Utils, Type, <Platform Support>, <Global Constants>, README (MOD) Array, Var, Status, MemMan, <Common>
This commit is contained in:
16
Utils/src/utils.c
Normal file
16
Utils/src/utils.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <Compound/utils.h>
|
||||
|
||||
int Utils_CalcDigits(long long n)
|
||||
{
|
||||
if (n == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
n = llabs(n);
|
||||
|
||||
/* Accumulate. */
|
||||
register int i;
|
||||
for (i = 0; n; i++) n /= 10;
|
||||
|
||||
return i;
|
||||
}
|
Reference in New Issue
Block a user