www.digitalmars.com         C & C++   DMDScript  

c++ - powl bug

reply "David Grimes" <dgrimes friberg.us> writes:
#include <math.h>
#include <stdio.h>

int main(){
 printf("(1.45445e-500)^0.707316 = %Lg", powl(1.45445e-500l, 0.707316l));

 return 0;
}

The output from the above code (compiled with DMC v8.37) is:
(1.45445e-500)^0.707316 = 0

David
Nov 03 2003
parent Keith Fuller <Keith_member pathlink.com> writes:
I get the same result in Visual Basic.  VB is also wrong.  Or maybe not.

In article <bo5efg$n6e$1 digitaldaemon.com>, David Grimes says...
#include <math.h>
#include <stdio.h>

int main(){
 printf("(1.45445e-500)^0.707316 = %Lg", powl(1.45445e-500l, 0.707316l));

 return 0;
}

The output from the above code (compiled with DMC v8.37) is:
(1.45445e-500)^0.707316 = 0

David
Nov 03 2003