1
$\begingroup$

I was creating a simple quiz. I noticed that wolframalpha converts 0.25 miles into 15800 inches while google converts it into 15840 inches. Is it a bug or did I make some miscalculation?

$\endgroup$
  • $\begingroup$ If you use 1/4 miles instead of .25 miles you get ``15840` inches in WA. $\endgroup$ – kglr Dec 7 '14 at 22:31
  • $\begingroup$ @kguler any explanation for weird behaviour? $\endgroup$ – Santosh Linkha Dec 7 '14 at 22:32
  • $\begingroup$ Santosh, not sure... Using .250 miles also gives the correct result (WolframAlpha["convert .250 miles to inches", {{"Result", 1}, "ComputableData"}]). $\endgroup$ – kglr Dec 7 '14 at 22:38
  • 4
    $\begingroup$ WA knows about significant figures and google does not. Put 0.2500 into WA and you get improved precision $\endgroup$ – bobthechemist Dec 7 '14 at 22:38
  • $\begingroup$ Using precision implied by significant figures the "correct" answer is 16000. And how come .250005 -> 15840` not 15840.3 ? $\endgroup$ – george2079 Dec 8 '14 at 18:33
2
$\begingroup$

Using exact numbers or higher precision numbers gives the result that matches google's output:

WolframAlpha["convert 1/4 miles to inches", {{"Result", 1}, "ComputableData"}]
(* 15840 in *)

WolframAlpha["convert .250 miles to inches", {{"Result", 1}, "ComputableData"}]
(* 15840 in *)

Another example:

WolframAlpha["convert 1/5 miles to inches", {{"Result", 1}, "ComputableData"}]
(* 12672 in *)

WolframAlpha["convert " <> # <> "miles to inches", {{"Result", 1}, "ComputableData"}] & /@ 
{".2", ".20", ".200", ".2000"}
(* {12700 in, 12700 in, 12670 in, 12672 in} *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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