updating sqrt to work with doubles

This commit is contained in:
hugogogo
2026-05-09 14:43:26 +02:00
parent 8edf428fed
commit ae9787ba6d
3 changed files with 48 additions and 22 deletions

View File

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