3 ms·
Does this solve the problem of consistency in computational geometry? I.e. point lies inside a polygon, but due to rounding errors, the point seems to lie outsi
by amelius 7y ago
Does this solve the problem of consistency in computational geometry? I.e. point lies inside a polygon, but due to rounding errors, the point seems to lie outside the polygon, which might trigger e.g. a program crash.
- injidup 7y agoNo
- garmaine 7y agoNo, but there are other ways of solving that. Setting rounding modes and bias values appropriately would prevent what you describe.
- nwallin 7y agoYou mean dynamically setting rounding modes depending on what operation you're doing? How do you do this performantly while staring down the barrel of context switching, third party dependencies, programmers who are at least as dumb as I am...? My general rule of thumb is that if your code might fail if someone swaps out IEEE 754 floating point semantics for some other representation that's at most as goofy as IEEE 754, your code is probably wrong.
- garmaine 7y agoContext switching preserves fpu modes. You set these inside inner loops where you aren’t calling out to third party dependencies. Good libraries make this easy to work with. This is exactly how IEEE 754 was designed to work, and is what all the major numerical libraries do.
- nutjob2 7y agoYes, if you do it algebraically. This is one of the things that this talk touches upon. BAsically if you use GA you eliminate precision issues (at least until you render or otherwise materialise), various special cases, limitations and unnecessary complexity.