4 ms·
In bash $ echo "print((-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3)" | sed "s/\^/**/g" | python - 42
by antoineMoPa 7y ago
In bash
$ echo "print((-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3)" | sed "s/\^/**/g" | python -
42
- hazeii 7y agoIn 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.
- wruza 7y agoOne more proof that you can do everything in bash.
- saagarjha 7y agoWithout shelling out: $ echo $(((-80538738812075974)**3 + 80435758145817515**3 + 12602123297335631**3)) 42
- Franciscouzo 7y agoYou're just using python, using bc is more bashy: $ echo '(-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3' | bc 42