News for hackers. Stuff that matters.
Re:42 is found to be the sum of three cubes by antoineMoPa on Friday September 06, 2019 @10:54AM (#20896186)
In bash

  $ echo "print((-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3)" | sed "s/\^/**/g" | python -
  42
Re:42 is found to be the sum of three cubes by Franciscouzo on Friday September 06, 2019 @12:01PM (#20896830)
You're just using python, using bc is more bashy:

    $ echo '(-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3' | bc
    42
Re:42 is found to be the sum of three cubes by saagarjha on Friday September 06, 2019 @11:57AM (#20896793)
Without shelling out:

  $ echo $(((-80538738812075974)**3 + 80435758145817515**3 + 12602123297335631**3))
  42
Re:42 is found to be the sum of three cubes by hazeii on Friday September 06, 2019 @11:03AM (#20896258)
In calc:

$ calc

calc 2.12.4.1

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

        42
>

Literally pasted off the web page and verified in a couple of seconds.

Re:42 is found to be the sum of three cubes by wruza on Friday September 06, 2019 @11:53AM (#20896750)
One more proof that you can do everything in bash.