4 ms·
Why doesn't this evaluate in Excel? =(-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3 Returns 1.09785E+36
by whitehouse3 7y ago
Why doesn't this evaluate in Excel?
=(-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3
Returns 1.09785E+36
- outside1234 7y agoInteger overflow?
- dagw 7y agoExcel can't to math on arbitrarly large ints, so tuncates all the numbers and gives you the wrong result
- pfd1986 7y agohttps://support.office.com/en-us/article/set-rounding-precision-e5d707e3-07a8-4df2-810c-218c531eb06a https://support.office.com/en-us/article/set-rounding-precis...
- Tuna-Fish 7y agoBecause the numbers cubed are way larger than the numbers that Excel can represent precisely. Excel uses 64-bit IEEE 754 floats for all arithmetic. They can be used to accurately describe integers smaller than 2^53, or ~10^16. The first number cubed is ~-5*10^50, so you are very clearly outside the range where excel is precise. You should not use Excel to do any serious mathematics, or really anything else where numerical precision is important.
- colejohnson66 7y agoWhy is it that a program that people use for accounting doesn’t use arbitrary precision arithmetic?
- jz391 7y agoBecause for accounting the numbers easily fit in the supported range; even the US National Debt (https://www.usdebtclock.org/ https://www.usdebtclock.org/)...
- LandR 7y agosame as Google. https://www.google.com/search?sxsrf=ACYBGNQRb1b08L-cU-JY3GHr1g7i3J6IkQ%3A1567781760883&source=hp&ei=gHNyXe7AM6KOlwSMyqrABw&q=%28-80538738812075974%29%5E3+%2B+80435758145817515%5E3+%2B+12602123297335631%5E3&oq=%28-80538738812075974%29%5E3+%2B+80435758145817515%5E3+%2B+12602123297335631%5E3&gs_l=psy-ab.3...605.605..1234...0.0..0.88.88.1......0....2j1..gws-wiz.pvDp1QT19IE&ved=0ahUKEwjugMOXurzkAhUix4UKHQylCngQ4dUDCAc&uact=5 https://www.google.com/search?sxsrf=ACYBGNQRb1b08L-cU-JY3GHr...
- nathanm412 7y agoOddly enough, it works for Bing. https://www.bing.com/search?q=%3D%28-80538738812075974%29%5E3+%2B+80435758145817515%5E3+%2B+12602123297335631%5E3&qs=n&form=QBLH&sp=-1&pq=&sc=0-0&sk=&cvid=B540CAB1ED494BFCA0244CDA6017D9FB https://www.bing.com/search?q=%3D%28-80538738812075974%29%5E...
- conjectures 7y agoWelcome to numerical computing :D! Btw: julia> (-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3 42
- wglb 7y agoOr CL-USER> (+ (expt -80538738812075974 3) (expt 80435758145817515 3) (expt 12602123297335631 3)) 42
- omaranto 7y agoYou need more precision. Try this in your browser console instead, using the new BigInt type in JavaScript: (-80538738812075974n)**3n + 80435758145817515n**3n + 12602123297335631n**3n
- timerol 7y agoExcel is probably coercing them to floating point, instead of using infinite-precision integers. Wolfram-Alpha gets it right: https://www.wolframalpha.com/input/?i=%28-80538738812075974%29%5E3+%2B+80435758145817515%5E3+%2B+12602123297335631%5E3 https://www.wolframalpha.com/input/?i=%28-80538738812075974%...
- tempWinHater 7y agoWorks in Windows calculator.
- julienchastang 7y agoNo need to downvote this comment. It is a legitimate numerical computation question and one that has interesting answers as evidenced by this sub-thread. Not everyone knows about how computers do floating point arithmetic, handles large ints, or otherwise.
- tejtm 7y agoSadly `awk/gwak` fails as well returning 198929873392615583518074640613244928 I take that back, needs the `M` flag awk -M 'END{print (-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3}' /dev/null 42 but `bc` of course works echo '(-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3' | bc 42