MathGroup Archive 1999

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

Search the Archive

Re: Checking for non-complex numerics

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21072] Re: [mg20983] Checking for non-complex numerics
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Sun, 12 Dec 1999 23:51:37 -0500 (EST)
  • References: <8278vc$a5h$1@dragonfly.wolfram.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Andrzej:
Also

Map[TrueQ[Element[#, Reals]] &, {Pi, 2.3, 2.3*I, b, Pi*I, E^(Pi)}]

{True, True, False, False, False, True}

Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565



"Andrzej Kozlowski" <andrzej at tuins.ac.jp> wrote in message
news:8278vc$a5h$1 at dragonfly.wolfram.com...
> In[1]:=
> NonComplex[x_] := Element[x, Reals] && NumericQ[x]
> seems to satisfy your requirements:
>
> In[2]:=
> Map[NonComplex, {Pi, 2.3, 2.3*I, b, Pi*I, E^(Pi)}]
> Out[2]=
> {True, True, False, False, False, True}
>
> > From: "DIAMOND Mark" <noname at noname.com>
To: mathgroup at smc.vnet.net
> > Organization: The University of Western Australia
> > Date: Wed, 1 Dec 1999 01:50:56 -0500 (EST)
> > To: mathgroup at smc.vnet.net
> > Subject: [mg21072] [mg20983] Checking for non-complex numerics
> >
> > I would like a function that returns True for non-complex numerics only.
To
> > be more specific, anything that results in NumericQ returning True is
OK,
> > such as Pi, E, 1, -2.6.
> >
> > a=-1.5;
> > followed by NonComplexQ[a] should return True. But
> > NonComplexQ[b] and NonComplexQ[Pi I] should return False as should
> > NonComplexQ[1.1 + 3 I].
> >
> > I have been able to a function that satisfies various subsets of these
> > conditions, but not the whole lot ... yet it seems the kind of problem
for
> > which there should be a simple and obvious solution.
> >
> >
> >
> >
> >
>
>
>
>



  • Prev by Date: Re: Ticker Tape/Theater Marquee Display?
  • Next by Date: discrepancy in Hypergeometric1F1 results
  • Previous by thread: RE: Checking for non-complex numerics
  • Next by thread: Re: Checking for non-complex numerics