blob: 3aacca3a0a13ee66ff1fdeb5b1ee46c9c9f8552a (
plain)
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
35
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putnbr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/14 17:07:00 by rbousset #+# #+# */
/* Updated: 2020/02/14 17:07:00 by rbousset ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include <libft.h>
#include <unistd.h>
#include <inttypes.h>
void
ft_putnbr(long nb)
{
long i;
i = nb;
if (nb < 0)
{
ft_putchar('-');
i = -nb;
}
if (i > 9)
{
ft_putnbr(i / 10);
ft_putchar((i % 10) + '0');
}
else
ft_putchar(i + '0');
}
|