News for hackers. Stuff that matters.
Re:42 is found to be the sum of three cubes by erikig on Friday September 06, 2019 @02:34PM (#20898421)
Strangely, typing this into Google does NOT result in 42

((-80538738812075974)^3)+(80435758145817515^3)+(12602123297335631^3)

Re:42 is found to be the sum of three cubes by kelnos on Friday September 06, 2019 @02:47PM (#20898581)
DDG doesn't handle it correctly either (gives the same very-large answer as Google). I assume there's some sort of integer overflow going on somewhere. Wolfram Alpha does ok, though: https://www.wolframalpha.com/input/?i=%28%28-805387388120759...
Re:42 is found to be the sum of three cubes by FreeFull on Friday September 06, 2019 @02:54PM (#20898655)
Google and Duckduckgo use floating point rather than arbitrary precision integers. Wolfram Alpha's solver is significantly more advanced (including arbitrary precision for integers and floating point numbers)
Re:42 is found to be the sum of three cubes by apaprocki on Friday September 06, 2019 @07:23PM (#20900767)
I’m actually surprised someone at Google hasn’t switched to BigInt yet in JS if the browser supports it? Googlers, front page OKR time! :)
Re:42 is found to be the sum of three cubes by brlewis on Friday September 06, 2019 @05:35PM (#20900128)
If you're typing it into google on a desktop browser, open your JS console. As earlier comments pointed out, in JavaScript it's

  (-80538738812075974n)**3n + 80435758145817515n**3n + 12602123297335631n**3n
Re:42 is found to be the sum of three cubes by grawprog on Friday September 06, 2019 @05:21PM (#20900020)
Surprisingly, the calculator that shipped with my phone seems to handle it well.
Re:42 is found to be the sum of three cubes by emergie on Friday September 06, 2019 @03:57PM (#20899308)
for big numbers you can use bc (infix) or dc (rpn) calculator:

echo '((-80538738812075974)^3)+(80435758145817515^3)+(12602123297335631^3)' | bc

echo '_80538738812075974 3 ^ 80435758145817515 3 ^ 12602123297335631 3 ^ + + p' | dc

Re:42 is found to be the sum of three cubes by xelxebar on Saturday September 07, 2019 @07:19PM (#20907342)
Nice! My go to calc is dc. If you're like me at all, then you might like to know that we can avoid the pipe usng the -e switch

    $ dc -e '_80538738812075974 3^ 80435758145817515 3^+ 12602123297335631 3^+p'
Re:42 is found to be the sum of three cubes by jjtheblunt on Friday September 06, 2019 @03:42PM (#20899171)
WolframAlpha should handle it fine, with Mathematica behind the scenes.
Re:42 is found to be the sum of three cubes by leecarraher on Friday September 06, 2019 @03:55PM (#20899299)
python handles big int automatically:

sh-4.2$ python -c "print(-805387388120759743+804357581458175153+126021232973356313)" 42

Re:42 is found to be the sum of three cubes by skykooler on Friday September 06, 2019 @04:12PM (#20899461)
Hn seems to have stripped the asterisks from your message.
Re:42 is found to be the sum of three cubes by emergie on Friday September 06, 2019 @04:11PM (#20899442)
nah, bigint is just another wall you may hit

bc/dc arbitrary precision calculators are usually installed by default on *nix platforms and they handle numbers with thousands of digits

$ time echo '12345^67890' |bc |wc -c

285941

real 0m2.137s

user 0m2.128s

sys 0m0.012s

Re:42 is found to be the sum of three cubes by HALtheWise on Friday September 06, 2019 @05:21PM (#20900023)
Python's default number implementation has full support for arbitrarily large numbers, and will allocate more memory as needed to do so, making the original claim correct.