Don't bother with "correct" units for the pressure_time calculation

Linus Torvalds torvalds at linux-foundation.org
Sun Jan 6 23:41:30 PST 2013


On Sun, Jan 6, 2013 at 11:33 PM, Linus Torvalds
<torvalds at linux-foundation.org> wrote:
> I fixed the pressure-time calculations to use "proper" units, but
> thinking about it some more, it turns out that units don't really
> matter.

All the "rounding errors" ended up being neither rounding errors nor
unit errors, but simply code logic errors. With all the cleanup, that
became more obvious.

I have a patch that actually changes the pressure_time integral to use
integer types. It works fine. We still use floating point for the
actual approximation phase, but that's just the final touch-up.

The nice thing about using integer types is that domain errors end up
showing as *huge* issues, not as subtle rounding issues. So I don't
think it really matters, but at the same time, integer math is a lot
less subtle than the things that FP can result in.

                Linus


More information about the subsurface mailing list