-2

if the range of d is 1<= d <= 10^101 and n is 1<= n <= 200. since the range of double is 2.3E-308 to 1.7E+308. when i take input 11111111111111111111 as d then the value d become 11111111111111111000.000 when i show the value to terminal. that means that it couldn't take the input correctly then how will it give correct value for 10^101. i need know the nth root of d. d will be always in form of p = k^n. that's why i added pow function to know the nth root. but the problem is that the range of p is huge. what i am trying is to solve this problem Power of Cryptography !

int main(){

 double d,n;

 scanf("%lf%lf", &n, &d))
 {
     printf("%lf\n", pow(d, 1/n));
 }

  return 0;
}

1 Answers1

4

A double precision number is not capable of holding all the values between 2.3E-308 to 1.7E+308, it is capable of holding a value between these numbers to a precision of about 15 decimal places.

That means some numbers (such as your example) require more precision than the 8 bytes of data can store.

mksteve
  • 12,614
  • 3
  • 28
  • 50