Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: Re: MathML 3 working group
  • Next by Date: Re: Logical comparisons of items in a two lists
  • Previous by thread: Apparently inconsistent behaviour of Convert[#, 1] &
  • Next by thread: Re: Mathematica 6.0 is released!