updating sqrt to work with doubles
This commit is contained in:
@@ -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);
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user