Search code examples
wolfram-mathematicaprecision

Mathematica precision differs from other calculators


If I evaluate the following input in Mathematica 12:

SetPrecision[DecimalForm[123.432654/54.1122356, 130], 130]

The result is:

2.2810488724291406725797060062177479267120361328125000000000000000000000000000000000000000000000000000000000000000000000000000000000

When I run the same calculation in other calculators, the results are equal until the 15th digit of the Mathematica result: 2,281048872429140. However, as of the 16th digit, the other calculators show an equal result whereas Mathematica is showing a different result:

Windows Calculator: 2,281048872429140591633586101550

https://keisan.casio.com/calculator: 2.281048872429140591633586101550[.....]

https://www.mathsisfun.com/calculator-precision.html: 2.281048872429140591633586101550[.....]

Mathematica: 2.281048872429140672579706006217[.....].

Why is (only) Mathematica ending up with a different result?

Can Mathematica somehow end up with the same result as the other calculators (supposing that these unanimous results are the correct ones)?


Solution

  • It seems those other calculators assume that the precision of the entered numbers is infinite. WL does not. You can specify what precision the entered numbers have e.g.

    123.432654`30/54.1122356`30
    
    2.28104887242914059163358610155