-
-
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
6 replies 1 retweet 27 likesShow this thread -
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
2 replies 1 retweet 33 likesShow this thread -
The inline routine has the advantage of returning the correct answer, whereas `Math.pow` evidently has some kind of bug
1 reply 0 retweets 12 likesShow this thread -
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
1 reply 0 retweets 11 likesShow this thread -
I imagine the separate integer exponentiation routine was hand-written for performance gains over calling `Math.pow` in certain scenarios
2 replies 0 retweets 9 likesShow this thread -
Try this, kids at home! (V8 only AFAIK so Chrome or Node.js)pic.twitter.com/cFB2pWFRlA
5 replies 28 retweets 82 likesShow this thread -
For serious though where/how do I raise this
4 replies 0 retweets 8 likesShow this thread -
I would appreciate that, thank you, it would save me registering an account and figuring out protocol and suchlike. Do share the link if possible
-
-
Replying to @qntm @tabatkins
Seems like it's between V8 versions 7.1.302.31 and 7.2.502.25, commits: https://chromium.googlesource.com/v8/v8/+log/7.1.302.31..7.2.502.25 …
1 reply 0 retweets 0 likes -
0 replies 0 retweets 1 like
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.