diff options
Diffstat (limited to 'arch/x86/lib/misc.c')
-rw-r--r-- | arch/x86/lib/misc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/lib/misc.c b/arch/x86/lib/misc.c new file mode 100644 index 0000000..bc35cde --- /dev/null +++ b/arch/x86/lib/misc.c @@ -0,0 +1,11 @@ +int num_digits(int val) +{ + int digits = 0; + + while (val) { + val /= 10; + digits++; + } + + return digits; +} |