/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_power.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: gbrochar +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/12/05 15:23:07 by gbrochar #+# #+# */ /* Updated: 2015/12/07 11:03:41 by gbrochar ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" int ft_power(int nb, int pow) { int ret; ret = 1; if (pow < 0) return (-1); while (pow--) ret *= nb; return (ret); }