Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • \$\begingroup\$ Nice mix of brute-force and work-saving. \$\endgroup\$ Commented Jul 21, 2017 at 0:27
  • \$\begingroup\$ Since this shows that a fairly simple brute-force approach works, I was thinking of implementing this in x86 machine code. I could probably get it working in 100 to 200 bytes, doing all the extended-precision stuff manually of course, but it would take significant development time, especially to golf it + optimize it. My plan was 32-bit chunks of base10**9 so it's easy to truncate down to 1006 digits, and easy to convert to a decimal string without arbitrary-precision division. Just a div loop to make 9 decimal digits per-chunk. Carry during adds with cmp/cmov and 2xADD instead of ADC. \$\endgroup\$ Commented Jul 23, 2017 at 5:36
  • \$\begingroup\$ Thinking about it enough to type that previous comment got me hooked. I ended up implementing it in 106 bytes of x86 32-bit machine code using that idea, running in 1min13s on my computer vs. 12min35s on my desktop for this python version (which spends most of its time dividing by 10, which is not fast for extended precision base2 numbers!) \$\endgroup\$ Commented Jul 25, 2017 at 9:33