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
I created the Antimemetics Division. http://scp-wiki.wikidot.com/antimemetics-division-hub …
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
Add this Tweet to your website by copying the code below. Learn more
Add this video to your website by copying the code below. Learn more
By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.
| Country | Code | For customers of |
|---|---|---|
| United States | 40404 | (any) |
| Canada | 21212 | (any) |
| United Kingdom | 86444 | Vodafone, Orange, 3, O2 |
| Brazil | 40404 | Nextel, TIM |
| Haiti | 40404 | Digicel, Voila |
| Ireland | 51210 | Vodafone, O2 |
| India | 53000 | Bharti Airtel, Videocon, Reliance |
| Indonesia | 89887 | AXIS, 3, Telkomsel, Indosat, XL Axiata |
| Italy | 4880804 | Wind |
| 3424486444 | Vodafone | |
| » See SMS short codes for other countries | ||
This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.
Hover over the profile pic and click the Following button to unfollow any account.
When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.
The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.
Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.
Get instant insight into what people are talking about now.
Follow more accounts to get instant updates about topics you care about.
See the latest conversations about any topic instantly.
Catch up instantly on the best stories happening as they unfold.
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
Simpler repro:
const x = 99;
console.log(x ** x - 99 ** 99);
It’s fixed in @v8js master. See https://bugs.chromium.org/p/v8/issues/detail?id=5848 ….
Ah interesting. I was just surprised that the loop suddenly changes evaluates differently with i = 13k ^^ Thanks for chiming in :D
Nothing in Chrome 72.0.3626.96 but 8939 in Canary 74.0.3694.0 (Mac). console.log(x ** x - 99 ** 99) is undefined and -5.311379928167671e+182 respectively. (Such quirks are priceless.)
If you're trying this is in Chrome's developer tools here on a Twitter page, please note that Twitter replaces `console.log` with an empty function. Ran into this myself. That might be why you're seeing `undefined`
Ah, that's it. Thanks.
Wait, why? Twitter?
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.