-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_int_size.c
28 lines (26 loc) · 1.02 KB
/
ft_int_size.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_int_size.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mrychkov <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/02/16 17:07:22 by mrychkov #+# #+# */
/* Updated: 2018/02/16 17:08:19 by mrychkov ### ########.fr */
/* */
/* ************************************************************************** */
int ft_int_size(int n)
{
int len;
len = 0;
if (n == 0)
return (1);
while (n < 0)
len++;
while (n)
{
n = n / 10;
len++;
}
return (len);
}