/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_iterative_factorial.c                           :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: rodaniel <marvin@42.fr>                    +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2017/08/06 15:32:33 by rodaniel          #+#    #+#             */
/*   Updated: 2017/08/06 15:32:41 by rodaniel         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

int		ft_iterative_factorial(int nb)
{
	long i;

	i = nb;
	if (nb <= 0 || nb >= 13)
		return ((nb == 0) ? 1 : 0);
	nb--;
	while (nb > 0)
	{
		i = nb * i;
		nb--;
	}
	return (i);
}
