-
Notifications
You must be signed in to change notification settings - Fork 1
/
ft_intlen.c
26 lines (23 loc) · 1023 Bytes
/
ft_intlen.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_intlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: smonroe <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/29 20:09:46 by smonroe #+# #+# */
/* Updated: 2018/05/29 20:10:41 by smonroe ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_intlen(int n)
{
int l;
l = (n <= 0) ? 1 : 0;
while (n != 0)
{
n /= 10;
l++;
}
return (l);
}