|
From: Dallman, J. <joh...@si...> - 2008-05-06 13:10:36
|
You'll do better to run your app with 64-bit precision throughout, even when it isn't running under valgrind. fpu_control.h has the constants and functions you'll need to do that. -- John Dallman Parasolid Porting Engineer > -----Original Message----- > From: val...@li... [mailto:valgrind- > use...@li...] On Behalf Of jody > Sent: Tuesday, May 06, 2008 1:41 PM > To: Michael Poole > Cc: val...@li... > Subject: Re: [Valgrind-users] precision problem > > Thanks for the info! > As i don't need 80bit precision, I guess i'll get by with > some appropriate floating point tricks such as addin small > values and rounding.... > > Jody > On Tue, May 6, 2008 at 1:53 PM, Michael Poole <md...@tr...> > wrote: > > 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 > > > > ----------------------------------------------------------------------- > -- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/ > javaone > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users |