MathGroup Archive 2010

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

Search the Archive

Re: ToExpression[ToString[expr]]=E2=89 _expr


You don't want OutputForm as the input to ToString

ToString[1/3] // FullForm

"1\n-\n3"

ToExpression[ToString[#[1/3]]] & /@
 {InputForm, StandardForm,
  TraditionalForm, OutputForm}

{1/3, 1/3, 1/3, -3}


Bob Hanlon

---- James Stein <mathgroup at stein.org> wrote: 

=============
Evaluating:

   ToExpression [ ToString [ 1/3 ] ]

I did not expect negative three!

Bug? or a lack in my understanding?




  • Prev by Date: Re: ProgressIndicator inside DynamicModule
  • Next by Date: Re: ToExpression[ToString[expr]]=E2=89 _expr
  • Previous by thread: ToExpression[ToString[expr]]=E2=89 _expr
  • Next by thread: Re: ToExpression[ToString[expr]]=E2=89 _expr