[PATCH] fpcmp fix (wrt sqlite3)

Renato Golin renato.golin at linaro.org
Thu Apr 4 16:25:02 PDT 2013


On 4 April 2013 22:25, Daniel Dunbar <daniel at zuster.org> wrote:

> I'm afraid of fpcmp the way it is written, so I'm hoping you did a fair
> amount of testing on it. :)
>

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.



ddunbar at ozzy-2:tmp$ echo "1.234b" > a
> ddunbar at ozzy-2:tmp$ echo "1.2341" > b
> ddunbar at ozzy-2:tmp$ fpcmp -a=.1 a b
> fpcmp: FP Comparison failed, not a numeric difference between 'b' and '1'
>

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.

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.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130405/ab849dfa/attachment.html>


More information about the llvm-commits mailing list