Re: Apparently inconsistent behaviour of Convert[#, 1] &
- To: mathgroup at smc.vnet.net
- Subject: [mg75479] Re: Apparently inconsistent behaviour of Convert[#, 1] &
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Wed, 2 May 2007 03:54:25 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <f171sh$9iu$1@smc.vnet.net>
Andrew Moylan wrote: > Convert[Sqrt[Meter^2], 1] >>> Meter > > Convert[2*Sqrt[Meter^2], 1] >>> \!\(Convert::"incomp" \(\(:\)\(\ \)\) "Incompatible units > in \!\(2\\ \@\(Meter\^2\)\) and \!\(1\)."\) >>> 2*Sqrt[Meter^2] > > Why does the latter conversion not succeed when the first one does? > > One is not a unit, so the results you might get are unpredictable. The following works in all cases: In[1]:= Needs["Miscellaneous`Units`"] Convert[Sqrt[Meter^2], Meter] Convert[2*Sqrt[Meter^2], Meter] Out[2]= Meter Out[3]= 2 Meter Regards, Jean-Marc