Re: Getting rid of annoying zeroes in algebraic expressions
- To: mathgroup at smc.vnet.net
- Subject: [mg15489] Re: Getting rid of annoying zeroes in algebraic expressions
- From: "William M. MacDonald" <wmacd at erols.com>
- Date: Mon, 18 Jan 1999 04:22:32 -0500
- References: <75q1n1$23s@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Are you doing algebra with Real numbers or integers and rational fractions? If you are, don't insert decimal points and you won't have this problem. -- William M. MacDonald Professor of Physics University of Maryland ---------- In article <75q1n1$23s at smc.vnet.net>, "Ross, Sean" <rosss at plk.af.mil> wrote: > > Let xx be the result of some algebraic manipulations which, for some > reason, mathematica thinks the real zeroes ought to be kept and I think > they ought to be dropped. > > xx=0. + (a*f)/(0. + f) + (b*f)/(0. + f) + (c*f)/(0. + f) > > xx/.Plus[0.,q_]->q > > returns > > 0. + (a*f)/(0. + f) + (b*f)/(0. + f) + (c*f)/(0. + f) > > while > > 0. + (a*f)/(0. + f) + (b*f)/(0. + f) + (c*f)/(0. + f)/.Plus[0.,q_->q] > > returns the expected > > a+b+c. > > xx is supposed to be equivalent to the expression, but in this case, it > is not. > I can't write a function to automatically drop zeroes if expressions > behave differently when they are alone on an input line and when they > are set equal to a symbol. Does anyone know how to eliminate this kind > of behavior? I am sure it has something to do with some obscure step > in the "standard evaluation cycle" and that there is probably a long, > convoluted explanation as to why someone would want this behavior, but > I don't and I would appreciate it if someone could tell me how to get > rid of it or circumvent it. > > Thanks, > > Sean Ross > > Please reply to rosss at plk.af.mil as I no longer subscribe to the > mathgroup. > >