Re: [Quickfix-developers] Possible Rounding Errors
Brought to you by:
orenmnero
From: Jody H. <jod...@at...> - 2004-04-27 19:58:03
|
On Tue, 27 Apr 2004 14:28:40 -0500 Oren Miller <or...@qu...> wrote: > Looking at this more closely, we have several tests that have trailing > > zeros, and this works fine. It looks like there are just too many > significant digits. Are they running on a 64 bit architecture? I > think the only thing you can do right now is to change the type to a > STRING in the data dictionary. The alternative is to comment out the > validation code for doubles. I doubt a 64 bit architecture is to blame. More than likely, a printf("%.15f"), or setting a large precision in an ostream, or something similar. The code to process doubles could be a *little* more understanding, by using the standard limits to truncate the value to the number of digits that can be represented on that hardware. In the case of a double, I'd think that would be better than rejecting the value. By definition, you can not throw around floating point values and expect to get the exact same value on different machines. That said, is there anything in the FIX spec that dictates precision of price values to something like 6 or 8 decimal places? |