MathGroup Archive 2002

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

Search the Archive

Re: Re: simplify expr to 1

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37959] Re: [mg37953] Re: simplify expr to 1
  • From: Andrzej Kozlowski <andrzej at platon.c.u-tokyo.ac.jp>
  • Date: Fri, 22 Nov 2002 04:16:08 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

> But some might argue that that isn't true either because
> sometimes the result is 1.0 instead of the integer 1.
>
> In[13]:=
>    x=2.3;
>    r=1/2;
>    x^r*(1/x)^r
>
> Out[15]=
>    1.
>
>
> In[16]:=
>    x=2;
>    r=0.5;
>    x^r*(1/x)^r
>
> Out[18]=
>    1.
>
>
I think this observation is based on a misinterpretation of the way 
Mathematica treats symbolic expressions. Essentially, if a symbolic 
expression does not contain floating point numbers then it is treated 
as exact. Thus:

In[1]:=
x/x

Out[1]=
1

while

In[2]:=
(1.x)/(1.x)

Out[2]=
1.

This is consistent with the fact that symbols always have infinite 
precision.




Andrzej Kozlowski
Yokohama, Japan
http://www.mimuw.edu.pl/~akoz/
http://platon.c.u-tokyo.ac.jp/andrzej/



  • Prev by Date: Possible Bug in Units2
  • Next by Date: Re: Extracting a sub-list?
  • Previous by thread: Re: simplify expr to 1
  • Next by thread: analytical solution