text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_putnbr_fd.c                                     :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: tidadi <marvin@42.fr>                      +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2018/11/08 20:39:19 by tidadi            #+#    #+#             */
  /*   Updated: 2018/11/08 20:39:36 by tidadi           ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  #include "libft.h"
  
  void	ft_putnbr_fd(int n, int fd)
  {
  	unsigned int i;
  
  	i = 1;
  	if (n < 0)
  	{
  		n = n * -i;
  		ft_putchar_fd('-', fd);
  	}
  	while (n / i >= 10)
  		i = i * 10;
  	while (i > 0)
  	{
  		ft_putchar_fd(((n / i) % 10) + '0', fd);
  		i = i / 10;
  	}
  }
  