-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_intlen.c
33 lines (31 loc) · 1.07 KB
/
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
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_intlen.c :+: :+: */
/* +:+ */
/* By: jaberkro <[email protected]> +#+ */
/* +#+ */
/* Created: 2021/12/08 13:13:49 by jaberkro #+# #+# */
/* Updated: 2021/12/08 13:14:49 by jaberkro ######## odam.nl */
/* */
/* ************************************************************************** */
int ft_intlen(int n)
{
int out;
out = 0;
if (n == -2147483648)
return (11);
if (n == 0)
return (1);
if (n < 0)
{
n *= -1;
out++;
}
while (n > 0)
{
out++;
n /= 10;
}
return (out);
}