On Mon, Oct 09, 2017 at 10:39:47PM +0200, Juan Francisco Cantero Hurtado wrote: > Marc Feeley (Gambit Scheme) has been helping me with a bug on Gambit on > Loongson. Apparently the bug is on our side. > > I've created this little test based on his code: > > #include <stdio.h> > #include <math.h> > > int main() > { > double x = 0.5; > double y = 1074.0; > printf("x=%.20g y=%.20g pow(x,y)=%.20g\n",x,y,pow(x,y)); > return 0; > } > > On OpenBSD/amd64, Linux/amd64, Linux/aarch64 and Linux/mips64: > x=0.5 y=1074 pow(x,y)=4.9406564584124654418e-324 > > On OpenBSD/loongson: > x=0.5 y=1074 pow(x,y)=-4.9406564584124654418e-324 > > Is the negative result expected?
No, even though what you are computing is ridiculous :) My first thought would on Loongson would be softfloat bug. But I am not 100% sure it (still) uses softfloat.