# What Every Computer Scientist Should Know About Floating-Point Arithmetic

#### Jun 05, 2017

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...

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...

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...

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.

#### Apr 02, 2017

For all those interested in Floating Point Arithmetic, I'd strongly recommend reading this paper:http://www.lsi.upc.edu/~robert/teaching/master/material/p5-g...

#### Mar 19, 2017

This reminds me of D. Goldberg's very old "What Every Computer Scientist Should Know About Floating-Point Arithmetic".[1] http://www.lsi.upc.edu/~robert/teaching/master/material/p5-g...