From: ragnar s. <rag...@po...> - 2003-07-10 14:32:28
|
Thanks for the help, I've upgraded to 1.9.6, but valgrind still gives the same result. Considering the following code: int main (int argc, char **argv) { float e; e = 0; e = e * (float)0.7; return 0; } Gcc treats: float e; e = e * 0.7; differently from : e = e * (float)0.7; As is shown in this assembler output, when toggling first with the (float) cast then without: --------------- .section .rodata .align 4 .LC0: .long 0x3f333333 .text .align 4 <snip> flds .LC0 fmulp %st,%st(1) -------------- .section .rodata .align 8 .LC0: .long 0x66666666,0x3fe66666 .text .align 4 <snip> fldl .LC0 fmulp %st,%st(1) ------- My guess is the first assembler output is using single-precision, and the second defaults to double ? So the func.c/prog.c should use double-precision correctly I assume ? Still, is there a error in the func.c/prog.c program, that valgrind thinks ? thanks Ragnar ___________________________________________________ Who invented the Centigrade scale of temperature? Find out at postmaster.co.uk http://www.postmaster.co.uk/cgi-bin/meme/quiz.pl?id=196 |