|
From: Michael P. <md...@tr...> - 2008-05-06 11:53:35
|
jody writes: > Hi > I'm using valgrind-3.2.1 on fedora 6. > > I have encounter a situation where computations with doubles > give different result when the application is run normally or under valgrind. > > > > Here is a very simple application showing the problem, vgt.c: Your test program behaves differently based on the implementation of "double". In particular, the 1950 result depends on the intermediate results being calculated using 80-bit floats, as is traditional on the stack of x86 FPUs. If the compiled code uses 64-bit floats, which will happen on x86-64 (and most other) machines, if you use gcc's -ffloat-store flag on x86 machines, or if you use Valgrind, it produces the 1949 result. According to http://valgrind.org/help/projects.html, the Vex library that underlies Valgrind only supports 64-bit floating-point arithmetic, so there is probably no way to get the 80-bit results within Valgrind. Michael Poole |