MathGroup Archive 2009

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

Search the Archive

Re: (2/3)[[1]]


Hi,

> but why can't Part be used with Rational?
> 
> i.e. (2/3)[[1]]

I think because Mathematica was designed/programmed like that. Rationals
are atoms, although their FullForm suggests otherwise. So they don't
have parts:

AtomQ[2/3]

You can access the numerator and denominator with the corresponding
functions, though:

Numerator[2/3]
Denominator[2/3]

hth,

albert


  • Prev by Date: Laplace Transform Exponential Shift
  • Next by Date: Re: (2/3)[[1]]
  • Previous by thread: Re: (2/3)[[1]]
  • Next by thread: Re: (2/3)[[1]]