libcfe  0.12.1
some useful C-functions
int_size.h File Reference
#include <sys/types.h>
Include dependency graph for int_size.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

size_t int_size (unsigned long long i, unsigned int base) __attribute__((const))
 

Function Documentation

◆ int_size()

size_t int_size ( unsigned long long  i,
unsigned int  base 
) const

Count the number of digits(numbers) in an integer when represented with given base.

Parameters
[in]iThe number.
[in]baseThe base number (binary -> 2, octal -> 8, decimal -> 10, hexadecimal -> 16), this must not be bigger than 16.
Returns
The number of characters when 'i' is represented with base 'base'. This is the same number as int_to_char will return.