On 30/07/13 12:59, hemant wrote:
I have written a std code for ARM 32-bit platform using math.h library and float=powf(float,float) function. When I give input to my system as 100 ^ 4.4 it gives me answer as 630957632.0000 (as float) whereas calculator in WindowsXP gives answer as 630957344.48019324943436013662234. I just want to know which one is more accurate ???? why is difference ????? on what things accuracy depends???? Also what do we mean by "arbitrary"-precision??? I have read such word on MSDN help forums. how much accurate is my system???? how to improve accuracy??????
Congratulations, you've just reached the limit for single-precision accuracy...
#include <math.h> #include <stdio.h> int main() { printf ("float %f\ndouble: %f\n", powf(100, 4.4), pow(100, 4.4)); return 0; } $ gcc pow.c -lm $ ./a.out float 630957632.000000 double: 630957344.480194 R.