-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_numlen_bonus.c
28 lines (25 loc) · 1.04 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
24
25
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_numlen_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lrocca <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/03 13:40:07 by lrocca #+# #+# */
/* Updated: 2021/02/06 16:30:47 by lrocca ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_numlen(unsigned long long n, int base)
{
size_t len;
if (n == 0)
return (1);
len = 0;
while (n)
{
n /= base;
len++;
}
return (len);
}