MathGroup Archive 2009

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

Search the Archive

Replace and ReplaceAll -- simple application

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105922] Replace and ReplaceAll -- simple application
  • From: amannuc1 <Anthony.J.Mannucci at jpl.nasa.gov>
  • Date: Sat, 26 Dec 2009 19:06:43 -0500 (EST)

I am doing some manipulations in Mathematica and end up with
constructs such as "1." in the expressions. I want to convert these to
"1" and thereby eliminate them. However, these examples don't seem to
work. This is Mathematica 7 on OS X.

In[40]:=
Replace[1.(y1-1.yr),1.->1]
Out[40]= 1. (y1-1. yr) (* Nothing happens *)

In[39]:=
ReplaceAll[1.(y1-1.yr),1.->1]
Out[39]= y1-1. yr (* Only first one is replaced *)

Any help is appreciated. Thanks.

-Tony


  • Prev by Date: problem with EvenQ
  • Next by Date: Re: Integration of Interpolation
  • Previous by thread: Re: problem with EvenQ
  • Next by thread: Re: Replace and ReplaceAll -- simple application