ajout sqartroot

This commit is contained in:
hugogogo
2021-07-25 12:49:58 +02:00
parent 60ebf29333
commit 1f234c4e58
3 changed files with 18 additions and 1 deletions

15
srcs/ft_sqrt.c Normal file
View File

@@ -0,0 +1,15 @@
#include "libft.h"
/*
** return the square root of nb
** or the integer value of it
*/
int ft_sqrt(int nb)
{
int i;
i = 0;
while ((i*i) < nb)
i++;
return (i);
}