Background:

I was watching a video about the “Diophantine equation” on YouTube (click here). tl;dr – someone finally found the 3 numbers x, y, and z, where:

`x^3 + y^3 + z^3 = 33 `

The three numbers are:

x = 8866128975287528

y = -8778405442862239

z = -2736111468807040

However, both R and Python provide the wrong answers when I sum the cubes of these three numbers, while Unix’s bc calculator provides the right answer.

R output:

`> x <- 8866128975287528 > y <- -8778405442862239 > z <- -2736111468807040 > (x^3 + y^3 + z^3) [1] -2535301200456458802993406410752 `

Python output (in Jupyter notebook):

`x = 8866128975287528 y = -8778405442862239 z = -2736111468807040 x^3 + y^3 + z^3 27885068152614 `

bc (unix calculator) output:

`x = 8866128975287528 y = -8778405442862239 z = -2736111468807040 x^3 + y^3 + z^3 33 `

I was just doing this out of boredom at work, but this has me worried. Only the Unix calculator provides the right answer, and both of the wrong answers provided by R and Python are different from each other! Does this mean they are unreliable if/when I might need to use large numbers in a data science project?

Any help would be appreciated. Thank you!