-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_put_long.c
34 lines (32 loc) · 1.15 KB
/
ft_put_long.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
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_put_long.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rabougue <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/07/07 23:11:30 by rabougue #+# #+# */
/* Updated: 2016/07/08 07:08:07 by rabougue ### ########.fr */
/* */
/* ************************************************************************** */
#include "./includes/libft.h"
void ft_put_long(long n)
{
if (n == -9223372036854775807 - 1)
{
ft_putstr("-9");
n = 223372036854775808;
}
if (n < 0)
{
ft_putchar('-');
n = -n;
}
if (n > 9)
{
ft_put_long(n / 10);
ft_put_long(n % 10);
}
else
ft_putchar('0' + n);
}