4 ms·
In Python >>> (-80538738812075974)**3 + 80435758145817515**3 + 12602123297335631**3 42
by petrikapu 7y ago
In Python
>>> (-80538738812075974)**3 + 80435758145817515**3 + 12602123297335631**3
42
- antoineMoPa 7y agoIn 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
- zests 7y agoIn dc/shell/bash dc -e '_80538738812075974 3 ^ 80435758145817515 3 ^ 12602123297335631 3 ^ + + p'
- taneliv 7y agoIn SQL: SELECT (-80538738812075974::NUMERIC)^3 + 80435758145817515::NUMERIC^3 + 12602123297335631::NUMERIC^3;
- xhroot 7y agoJavascript in FF/Chrome: > (-80538738812075974n)**3n + 80435758145817515n**3n + 12602123297335631n**3n 42n https://caniuse.com/#search=bigint https://caniuse.com/#search=bigint
- harryh 7y agoIn Scala: scala> BigInt("-80538738812075974").pow(3) + BigInt("80435758145817515").pow(3) + BigInt("12602123297335631").pow(3) res0: scala.math.BigInt = 42
- stefan_ 7y agoIn Google: 1.9892987e+35 It pains me how its 2019 and the fricking Google calculator is less powerful than a solar powered credit-card sized one from the 90s. A single chip made on the earliest imaginable IC processes can effortlessly deal with larger numbers than the lazy ignorant Google implementation. Maybe they can make this an interview question.
- abdulhaq 7y agoMost calculators of that era had a maximum number Of digits between 8 and 12. Perhaps the Hp48 could do this calculation but not any of the credit card calcs.
- Fuhrmanator 7y agoIn Pharo (-80538738812075974 raisedTo: 3) + (80435758145817515 raisedTo: 3) + (12602123297335631 raisedTo: 3) "42"