-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_power.c
21 lines (19 loc) · 1 KB
/
ft_power.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_power.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thifranc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/03/22 13:13:55 by thifranc #+# #+# */
/* Updated: 2016/03/31 11:37:50 by thifranc ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_power(int nb, int power)
{
if (power == 0)
return (1);
else
return (nb * ft_power(nb, power - 1));
}