Weirdly, the value returned by `143 ** 143` - i.e. the new, experimental exponentiation operator - is closer to the precise result than that returned from ancient stalwart `Math.pow`pic.twitter.com/YuWf3TJC6N
You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more
Weirdly, the value returned by `143 ** 143` - i.e. the new, experimental exponentiation operator - is closer to the precise result than that returned from ancient stalwart `Math.pow`pic.twitter.com/YuWf3TJC6N
OK so I think what's happening is that when V8 interprets an exponentiation expression dynamically (e.g. `x ** x`) it drops through to `Math.pow`, but when it sees a constant exponentiation expression (e.g. `99 ** 99`) it computes the result inline using a different routine?pic.twitter.com/akoTkZi4Ag
The inline routine has the advantage of returning the correct answer, whereas `Math.pow` evidently has some kind of bug
Furthermore, the inline routine seems to be in use for integers only, so it's not possible to simply retire `Math.pow`'s current (faulty) implementation and use the inline exponentiation dealie insteadpic.twitter.com/HCQuj6Ex5B
I imagine the separate integer exponentiation routine was hand-written for performance gains over calling `Math.pow` in certain scenarios
Try this, kids at home! (V8 only AFAIK so Chrome or Node.js)pic.twitter.com/cFB2pWFRlA
For future reference I'm seeing this in 64-bit Chrome 72.0.3626.96 on Windows, and in Node.js 10.15.1 which uses V8 6.8.275.32-node.12
Reportedly a long-known issue with a fix on its way down the pipelinehttps://twitter.com/mathias/status/1094209241311838210 …
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.