-
Notifications
You must be signed in to change notification settings - Fork 2
/
ft_numlen_bonus.c
23 lines (21 loc) · 1 KB
/
ft_numlen_bonus.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_numlen_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hbaddrul <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/01 17:13:14 by hbaddrul #+# #+# */
/* Updated: 2021/08/03 02:22:17 by hbaddrul ### ########.fr */
/* */
/* ************************************************************************** */
int ft_numlen(int n, int base)
{
int count;
count = 0;
if (n <= 0)
++count;
while (n && ++count)
n /= base;
return (count);
}