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
This is one of the most frustrating problems to me about working with big rationals or intervals. It’s attractively “clean” compared to floating-point numbers, but if you’re not careful, you constantly accumulate more and more “precision” that isn’t really meaningful—you could discard most of the digits of those rationals and end up with the same result when it’s converted to a double.
7 comments
[ 5.7 ms ] story [ 30.9 ms ] threadApparently 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:
instead of doing a custom division of x.num by x.denomPS. yep, it does just that:
https://github.com/peterolson/BigRational.js/blob/master/Big...
Browser: Firefox OS: Ubuntu
Here is the output:
a00 = 1432521999387336201000162233364364261412422778723249988532277223673502336434725335337083644796278416082366180670944929785069345/5986547728315893919428066873527575391908390247143416149511995033033437392431374342833088545303961365118098478697976518989268769 a00.valueOf() = 0.23929016595184258
A big framerate drop is to be expected after several rotations, as the numerators and denominators become very big.