Several float to int potential rounding errors/inconsistencies

Linus Torvalds torvalds at linux-foundation.org
Mon Mar 6 20:23:03 PST 2017


On Mon, Mar 6, 2017 at 7:59 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> Any other opinions on how to do this? I'm actually rather surprised that
> Linus hasn't spoken up. He must be busy with the merge window of that
> earlier, less interesting open source project he is involved in...

I certainly don't mind it, although I can't imagine that it matters
*that* much just how we round the millimeters. But if the "off by a
millimeter" causes test differences, by all means.. Doing the rounding
is definitely the right thing to do.

So ack on the patch.

I'd love to have some way to automatically find the places where we do
that "implicit cast from FP to int without proper rounding", but I
don't know of any such tool (sparse could be modified to do it, but
doesn't do C++).

               Linus


More information about the subsurface mailing list