Floating point madness.

How floating point can drive you crazy. Covers lots of topics like NaN , Infinity and when working with numbers with vastly different magnitudes.

Well worth a watch :)

https://www.youtube.com/watch?v=tw99HxpONws

#programming #math #floatingPointArithmetic

Floating point math is hard. Really, really hard.

YouTube

This error message in our app is why you don't put == or != between two floating point numbers in your code! πŸ˜…

> Error: Internal miscalculation: Volume (89.99999999999999) is not equal to upper limit (90.0)

#Code #Math #Python #FloatingPointArithmetic

All these recent discussions of error handling and mishandling and parsing and NaNs in my timeline all circulating like NaTs on an #Itanium are reminiscent of the video player controls seen on a very much not-small website.

Oh, and as for NaNs and videos, and for the ~three of you that haven’t yet seen it, β€œA lightning talk by Gary Bernhardt from CodeMash 2012”, a very short and very funny video on this same topic:

https://www.destroyallsoftware.com/talks/wat

#humor #humour #wat #NaN #floatingpoint #FloatingPointArithmetic #fp
https://oldbytes.space/@arclight/112047281273277753

Wat

Thanks Duolingo! I appreciate myself some EXTRA precise stats! 😎

#Duolingo #Floats #FloatingPoint #FloatingPointArithmetic #Precision

Interesting floating-point summation tip [ https://twitter.com/raymondh/status/1301800636866940928 ]:

"Raymond Hettinger @raymondh

#Python floating point ninja tip: Use parentheses to regroup sums to minimize accumulated round-off error.

Instead of:
a + b + c + d + e + f + g + h

Write:
((a + b) + (c + d)) + ((e + f) + (g + h))

Note, the total work is unchanged."

For more on this see [ https://en.wikipedia.org/wiki/Pairwise_summation ]

#FloatingPointArithmetic #Python #Programming

Raymond Hettinger on Twitter

β€œ#Python floating point ninja tip: Use parentheses to regroup sums to minimize accumulated round-off error. Instead of: a + b + c + d + e + f + g + h Write: ((a + b) + (c + d)) + ((e + f) + (g + h)) Note, the total work is unchanged. https://t.co/jnJuYzay7j”

Twitter
Extracting ROM constants from the 8087 math coprocessor's die

Intel introduced the 8087 chip in 1980 to improve floating-point performance on the 8086 and 8088 processors, and it was used with the ori...