#include <stdio.h>
float ft_sqrt(int nb){
float x = nb;
float y = (x+1) / 2;
printf("y = %f\n", y);
while(y < x){
x = y;
printf("fx.x = %f\n", x);
y = (x + nb / x) / 2;
printf("fx.y = %f\n", y);
}
return x;
}
int main() {
float a = ft_sqrt(3);
printf("%f", a);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: