/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_putnbr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: scebula +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/11/26 12:42:01 by scebula #+# #+# */ /* Updated: 2015/11/30 01:20:12 by scebula ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_putnbr(int n) { if (n == -2147483648) ft_putstr("-2147483648"); else { if (n < 0) { ft_putchar('-'); n = -n; } if (n >= 10) { ft_putnbr(n / 10); ft_putnbr(n % 10); } else ft_putchar(n + '0'); } }