-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpower_l.c
More file actions
25 lines (22 loc) · 1.07 KB
/
power_l.c
File metadata and controls
25 lines (22 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* power_l.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hiroshiusui <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/01/31 02:38:01 by hiroshius #+# #+# */
/* Updated: 2018/01/31 02:38:01 by hiroshius ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
long power_l(long number, int exponent)
{
long result;
result = 1;
if (exponent == 0)
return (result);
while (exponent--)
result = result * number;
return (result);
}