Hacker News new | ask | show | jobs
by Willox 3167 days ago
Your cube is disappearing for me after about 6 rotations in the same direction with Chrome 61.0.3163.100. Doesn't happen on the non-rational version.
1 comments

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