MathGroup Archive 2002

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

Search the Archive

Extracting a sub-list?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37933] Extracting a sub-list?
  • From: "AngleWyrm" <no_spam_anglewyrm at hotmail.com>
  • Date: Wed, 20 Nov 2002 09:09:02 -0500 (EST)
  • Reply-to: "AngleWyrm" <no_spam_anglewyrm at hotmail.com>
  • Sender: owner-wri-mathgroup at wolfram.com

How do I extract the subset of answers in a list that are pure integers?
As an example,

in:
Table[x/2, {x, 1, 5}]
IntegerQ /@ %

out:
{ 1/2, 1, 3/2, 2, 5/2 }
{ False, True, False, True, False }

But I want to get a result of:
{ 1, 2 }

-:¦:-
AngleWyrm



  • Prev by Date: Problem with ND
  • Next by Date: Re: How to avoid under/overflow?
  • Previous by thread: Re[2]: Problem with ND
  • Next by thread: Re: Extracting a sub-list?