
Discussion continued
FindTriangle (floatingpoint imprecision)
The evident approach for this problem is to use Heron's formula for calculating triangle's area. However, this is wrong: due to floatingpoint imprecision this formula returns nonzero area for some triangles with collinear vertices. A much safer way to calculate triangle's area is via crossproduct of vectors representing its sides (see recipe "Using Vector Operations" for details). Finally, since coordinates of vertices are integer, the area will be an integer divided by two. To avoid comparing floatingpoint areas, we can store and compare twiceareas and divide the maximal of them by 2 only when returning it.
Aircraft (floatingpoint imprecision + integer overflow)
This is a nice example of a problem in which both types of error can occur. See recipe "Working with Lines and Segments" for analyses and solution.
It is often helpful to do as many of your computations as possible in integers, switching to floatingpoint numbers only when it's really necessary. Thus, if you compare Euclidean distances between integer points, you can work with squared distances (which are integers) and extract square root only at the very end. Similarly, in PerforatedSheet you should calculate both total mass and weighted sum of rectangle center positions (multiplied by 2 again) in 64bit integer, and postpone the division to the last step.
See Also Recipe "Working with Numbers" for details on representation of integer and floatingpoint numbers. Recipe "Using Rational Arithmetic to Avoid Floating Point Imprecision" for another way to avoid floatingpoint imprecision. 