MathGroup Archive 2005

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

Search the Archive

Re: Re: Bug Report - Two numerical values for a same variable


The manipulations below are precisely what's so confusing about Rational 
objects (and Complex objects) being atoms.  If

   1/2 /. Rational[x_, 2] -> Rational[x, 7]

works, then why not the following?

   Part[Rational[1, 2], 2]

I can "believe" that integers and reals (and maybe strings) are atoms; 
but believing that rationals and complex numbers are atoms is a hard 
thing to swallow!

This has always bothered me -- and hence given me trouble trying to, um, 
rationalize this to students when I've taught Mathematica.


Scott Hemphill wrote:
> DrBob <drbob at bigfoot.com> writes:
> 
> 
>>That explains it, but only in the sense that "things fall down" is a theory of gravity. Why should Rationals be atomic, for goodness sake? And how did I use Mathematica all this time without hearing about it?
>>
>>Sigh...
> 
> 
> 
> In[1]:= FullForm[1/2]
> 
> Out[1]//FullForm= Rational[1, 2]
> 
> In[2]:= 1/2 /. Rational[x_,2] -> Rational[x,7]
> 
>         1
> Out[2]= -
>         7
> 
> Scott

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Quite Upset with NIntegrate
  • Next by Date: Re: Re: Using Select with arrays? (Relative newbie)
  • Previous by thread: Re: Bug Report - Two numerical values for a same variable
  • Next by thread: Re: Re: Re: Bug Report - Two numerical values for a same variable