home.social

#floatingpointarithmetic — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #floatingpointarithmetic, aggregated by home.social.

  1. 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 :)

    youtube.com/watch?v=tw99HxpONws

    #programming #math #floatingPointArithmetic

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

  3. Interesting floating-point summation tip [ twitter.com/raymondh/status/13 ]:

    "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 [ en.wikipedia.org/wiki/Pairwise ]

    #FloatingPointArithmetic #Python #Programming