13
$\begingroup$

Bug introduced in version 10 or earlier and fixed in version 10.0.2


I'm using 10.0 for Linux.

Trial 1:

Quantity[2,"meters"]
2 None meters

Trial 2:

Quantity[2,"Meters"]
2 meters

Trial 3:

Quantity[2,"meters"] //InputForm
Quantity[2*None, "Meters"]

It seems like MMA recognizes the correct unit, but also is sticking a None in some cases. I first happened upon this possible-bug by using "ElectronVolts" rather than "Electronvolts".

Is this a bug? (Should it be reported?)

$\endgroup$
  • 3
    $\begingroup$ It certainly looks like a bug to me ... though I don't use units, so I don't have much experience with this. I would report it. $\endgroup$ – Szabolcs Feb 4 '15 at 18:38
  • 4
    $\begingroup$ Yes, this does look like bad behavior due to an update on the Wolfram|Alpha server. I've notified the developers responsible for this content. $\endgroup$ – Nick Lariviere Feb 4 '15 at 19:43
  • $\begingroup$ @NickLariviere Thank you. $\endgroup$ – Jacob Schwartz Feb 5 '15 at 20:38
  • 1
    $\begingroup$ it probably is worth noting that it might be a good idea to use the "canonical unit names" in everything that you intend to run more than once. Doing so should (I think) not show the mentioned problem and also will be much faster and work without an internet connection, which alone seems to justify the effort to find out what these "canoncial unit names" are. To do that, just look at the InputForm of what a Quantity is transformed to. Getting the interpretation of unit strings from the Wolfram|Alpha servers is a design decisions which is certainly arguable... $\endgroup$ – Albert Retey Feb 6 '15 at 7:43
  • 1
    $\begingroup$ @JacobSchwartz, sorry for the delay in getting back but this should be resolved now(if you're still having trouble please let me know). $\endgroup$ – Nick Lariviere Feb 20 '15 at 19:01
7
$\begingroup$

Yes, this was a bug. It has been fixed as of 10.0.2.

In[1]:= Quantity[2, "meters"]
Out[1]= 2 m
$\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.