
Float or double? - teach
http://www.ilikebigbits.com/blog/2017/6/1/float-or-double
======
jepler
A good high-level overview for those new to the topic. Here's my advice:

If you have the time to do error analysis and performance optimization, then
maybe use float; if not, use double.
[http://www.lsi.upc.edu/~robert/teaching/master/material/p5-g...](http://www.lsi.upc.edu/~robert/teaching/master/material/p5-goldberg.pdf)

If you have to implement a numeric or geometric algorithm, even as simple as
"find the intersection of two infinite, non-parallel lines in 2D", use a
library; don't code it yourself.
[https://stackoverflow.com/questions/8585427/precision-
issues...](https://stackoverflow.com/questions/8585427/precision-issues-with-
segment-segment-intersection-code)

If you do code it yourself, study a reference that approaches things
numerically, not merely symbolically; the usual symbolic approach taught in
school is often not appropriate numerically. see e.g.,
[https://en.wikipedia.org/wiki/Loss_of_significance#Instabili...](https://en.wikipedia.org/wiki/Loss_of_significance#Instability_of_the_quadratic_equation)

Once you understand why you should teach beginning coders rules like the
above, even though they're huge over-simplifications, then use your own common
sense instead of these rules.

