-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_pow.c
More file actions
20 lines (18 loc) · 1006 Bytes
/
ft_pow.c
File metadata and controls
20 lines (18 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_pow.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ppanchen <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/18 16:35:29 by ppanchen #+# #+# */
/* Updated: 2017/02/01 18:35:14 by ppanchen ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_pow(int num, int p)
{
if (p == 0)
return (1);
return (num * ft_pow(num, p - 1));
}