Hacker News new | past | comments | ask | show | jobs | submit login

> Also the "field" of floating point numbers is not commutative, (can run on JS console:)

OK.

    >> x = 0;
       0
    >> for (let i=0; i<10000; i++) { x+=0.0000000000000000001; };
       1.0000000000000924e-15
    >> x + 1
       1.000000000000001
    >> 1 + x
       1.000000000000001

You've identified a problem, but it isn't that addition is noncommutative.





Yeah, what is demonstrated here is that floating point addition is nonassociative.



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: