-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lenghtunint.c
25 lines (22 loc) · 1.05 KB
/
ft_lenghtunint.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lenghtunint.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sbeline <sbeline@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/05/13 16:29:34 by sbeline #+# #+# */
/* Updated: 2016/05/13 16:29:35 by sbeline ### ########.fr */
/* */
/* ************************************************************************** */
#include "Includes/libft.h"
int ft_lenghtunint(unsigned int nb)
{
size_t ret;
ret = 1;
if (nb == UINT_MAX)
return (10);
while ((nb /= 10) > 0)
ret++;
return (ret);
}