MathGroup Archive 2011

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

Search the Archive

Re: Is there ToNumber?


I had imagined that applying Real to the string would make it a
number, e.g. Real@@"1.2", but it doesn't work:

In[1]:= Head[Real @@ "1.2"]

Out[1]= String

Of course ToExpression works as intented:

In[2]:= Head[ToExpression@"1.2"]

Out[2]= Real

Why can't I simply change the head of a string by using Apply?


  • Prev by Date: Question with ToExpression
  • Next by Date: Re: FindFit
  • Previous by thread: Re: Is there ToNumber?
  • Next by thread: Re: Is there ToNumber?