mamy kod :
double foo(double x, unsigned int n)
{
if (n==0)
return 1.0;
while ((n & 1) == 0)
{
n>>=1;
x*=x;
}
double result = x;
n>>=1;
while(n != 0)
{
x *= x;
if((n & 1) != 0)
result *=x;
n>>=1;
}
return result;
}
Dlaczego foo(1.0000001, -1) w różnych implementacjach może mieć inną wartość. Prosze o szybka odpowiedz .