News for hackers. Stuff that matters.
Re:Show HN: Implementing a trackball with rational numbers by grondilu on Monday October 16, 2017 @03:26PM (#15485963)
I had noticed the disappearance of the cube after a while indeed. With Firefox it happens much later than just six rotations though. Can't test it on chrome right now.

Apparently this happens when .valueOf() becomes NaN. I'll modify the code to display that value. Heck, I'll show the floating point approximation for the whole matrix.

.valueOf() becoming NaN is probably related to the behavior of big-rational.js. I suppose it does:

    x => x.num.valueOf()/x.denom.valueOf()
instead of doing a custom division of x.num by x.denom

PS. yep, it does just that:

https://github.com/peterolson/BigRational.js/blob/master/Big...

There are no comments on this comment yet.