adding modf pow and round

This commit is contained in:
hugogogo
2026-05-07 00:58:54 +02:00
parent 78f6a2d9ba
commit b768ac1a14
6 changed files with 79 additions and 3 deletions

19
srcs/ft_pow.c Normal file
View File

@@ -0,0 +1,19 @@
#include "libft.h"
/**
* returns the value of 'base' raised to the power of 'exponent'
*/
double ft_pow(double base, int exponent)
{
int i;
double result;
result = 1.0;
i = 0;
while (i < exponent)
{
result *= base;
i++;
}
return result;
}