<div dir="ltr">Hey Renato,<div><br></div><div style>I'm afraid of fpcmp the way it is written, so I'm hoping you did a fair amount of testing on it. :)</div><div style><br></div><div style>I think it would be cleaner to just change BackupNumber so that it is willing to backup one character behind the initial point, and I don't think there is any reason to require that character to be a space. Given the way the rest of it works it seems like this test case might as well pass:</div>
<div style>--</div><div>ddunbar@ozzy-2:tmp$ echo "1.234b" > a</div><div>ddunbar@ozzy-2:tmp$ echo "1.2341" > b</div><div>ddunbar@ozzy-2:tmp$ fpcmp -a=.1 a b</div><div>fpcmp: FP Comparison failed, not a numeric difference between 'b' and '1'</div>
<div style>--</div><div style><br></div><div style> - Daniel</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 3, 2013 at 11:07 AM, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>As reported in this bug:</div><div><br></div><a href="http://llvm.org/bugs/show_bug.cgi?id=15620" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=15620</a><br>
<div><br></div><div>fpcmp gets it wrong when comparing floating point numbers.</div>
<div><br></div><div>I found that it happens when comparing numbers with different number of digits, ex:</div><div><br></div><div><div>257359.326881721</div><div>257359.32688172</div><div><br></div>
<div>when fpcmp would compare the number with highest precision with the next one of the low precision.</div><div><br></div><div>The attached patch works around this by rolling back one byte if the difference is in a space AND the previous one is a number. Since only one of the numbers can be at the space (the shorter one), I only roll back one the shorter one.</div>

<div><br></div><div>This patch fixes sqlite3 on ARM and will probably fix on TILE-Gx, too.</div><div><br></div><div>Please review.</div><div><br></div><div>Thanks,</div><div>--renato</div>
</div></div>
</blockquote></div><br></div>