text: /* ************************************************************************** */
  /*                                                                            */
  /*                                                        :::      ::::::::   */
  /*   ft_atoi.c                                          :+:      :+:    :+:   */
  /*                                                    +:+ +:+         +:+     */
  /*   By: anajmi <anajmi@student.42.fr>              +#+  +:+       +#+        */
  /*                                                +#+#+#+#+#+   +#+           */
  /*   Created: 2021/07/06 17:03:00 by anajmi            #+#    #+#             */
  /*   Updated: 2021/07/10 13:25:16 by anajmi           ###   ########.fr       */
  /*                                                                            */
  /* ************************************************************************** */
  
  int	ft_atoi(char *str)
  {
  	int	a;
  	int	sign;
  	int	nbr;
  
  	a = 0;
  	nbr = 0;
  	while (str[a] == ' ' || (9 <= str[a] && str[a] <= 13))
  		a++;
  	sign = 1;
  	while (str[a] == '-' || str[a] == '+')
  	{
  		if (str[a] == '-')
  			sign *= (-1);
  		a++;
  	}
  	while ('0' <= str[a] && str[a] <= '9')
  	{
  		nbr *= 10;
  		nbr += str[a] - '0';
  		a++;
  	}
  	return (nbr * sign);
  }
  