Question: Transcribe this C code to Y86-64 float squareRoot(float n) { /*We are using n itself as initial approximation This can definitely be improved */ float
Transcribe this C code to Y86-64
float squareRoot(float n)
{
/*We are using n itself as initial approximation
This can definitely be improved */
float x = n;
float y = 1;
float e = 0.000001; /* e decides the accuracy level*/
while(x - y > e)
{
x = (x + y)/2;
y = n/x;
}
return x;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
