I understand that this is a common problem. However, I cannot find the correct direct answer.
16 ^ 54 = 1.0531229167e+65 (this is the result I want)
When I use pow(16,54) , I get:
105312291668557186697918027683670432318895095400549111254310977536,0
The code is as follows:
#include <stdio.h> #include <math.h> #include <stdlib.h> void main(){ double public; double a = 16; double b = 54; public = (pow(a,b)); printf("%.21f\n", public); }
Code executed with:
gcc main.c -lm
What am I doing wrong?
c printf pow
Simon
source share