2

I recently started learning about floating point arithmetic and a how computers have limited precision when dealing with such calculations.

To what degree of accuracy can Wolfram alpha output computations?

I was hoping to check the accuracy of some calculations in C++ by comparing them to answers outputted by Wolfram Alpha.

1 Answer 1

5

When requesting sqrt(2) with "more digits" Wolfram Alpha outputs

sqrt(2)

which far exceeds the accuracy of double-precision floating point variables (in which sqrt(2) is 1.4142135623730951).

WA is also smart about the organization of computation, preventing the loss of significant digits. For example, sqrt(10^100+1)-10^50 outputs a correct value, slightly less than 5e-51. Straightforward execution of the same computation is likely to return exactly 0.

So, the answer is yes: it is reasonable to check the accuracy of floating point computations using Wolfram Alpha.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.