I am calculating the distance between two 3D points in a program I am writing and using this math:
Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) + Math.pow(z2 - z1, 2))
Wolfram Alpha Query #1, same as my answer == 234,976.6474396
Wolfram Alpha Query #2, different than my answer == 234,977
Which one is correct? Why are they different?
You get the same effect if you ask for sqrt(1+1) versus distance between (0,0) and (1,1): the
sqrtresult has zillions of significant figures, but thedistanceresult has only 6.So this looks like a deliberate design decision, but I'm blowed if I can understand it.