21 lines
1015 B
C
21 lines
1015 B
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_math.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/04/02 22:37:55 by tischmid #+# #+# */
|
|
/* Updated: 2023/04/02 22:38:10 by tischmid ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ft_math.h"
|
|
|
|
int power(int nb, int exp)
|
|
{
|
|
if (exp < 1)
|
|
return (exp == 0);
|
|
return (nb * power(nb, exp - 1));
|
|
}
|