<div dir="ltr">On 4 April 2013 22:25, Daniel Dunbar <span dir="ltr"><<a href="mailto:daniel@zuster.org" target="_blank">daniel@zuster.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>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></blockquote><div><br></div><div style>I concur, that's not pretty code. I ran the whole test-suite with it, thinking there would be enough cases to prove me wrong. All passed.</div>
<div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>ddunbar@ozzy-2:tmp$ echo "1.234b" > a<br>
</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></blockquote>
<div><br></div><div style>True, this would make it fail, but I'm not sure how realistic it is on common outputs (and the reason why there wasn't a single example like that on the whole test-suite). However, I agree with you that if rolling back one digit breaks the comparison, it means they were different to begin with. I'll write the code a bit more generic and run some basic tests.</div>
<div style><br></div><div style>But I don't think this warranted a full test-suite on fpcmp. I'd rather spend more time later on it, if it fails on another case.</div><div style><br></div><div style>cheers,</div><div style>
--renato</div></div></div></div>