-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathft_nbrlen.c
28 lines (25 loc) · 1.02 KB
/
ft_nbrlen.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_nbrlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gamarcha <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/05/04 21:43:09 by gamarcha #+# #+# */
/* Updated: 2021/06/02 12:10:56 by gamarcha ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_nbrlen(int n)
{
size_t len;
len = 0;
if (n <= 0)
len++;
while (n)
{
n /= 10;
len++;
}
return (len);
}