Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Re: Types in Mathematica thread

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62918] Re: [mg62877] Re: Types in Mathematica thread
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Thu, 8 Dec 2005 00:06:24 -0500 (EST)
  • References: <dn38ft$3la$1@smc.vnet.net> <200512070412.XAA23854@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 7 Dec 2005, at 13:12, Jon Harrop wrote:

>
>   RealQ[_Real] := True
>   RealQ[_] := False
>
> for equivalence with the Head test "_Real", rather than the  
> mathematical
> concept of a real number.

Of course this is not fool-proof:

  RealQ[_Real] := True
   RealQ[_] := False


x=Real["I am not a number"];


RealQ[x]

True

One can, of course deal, with such perversity by:

  RealQ[x_Real] /; AtomQ[x] == True := True
   RealQ[_] := False

or

RealQ[x_Real] /; InexactNumberQ[x] == True := True
   RealQ[_] := False

Andrzej Kozlowski


  • Prev by Date: Re: Bug in Graphics output of Circle primitive?
  • Next by Date: Spatial Econometrics and NonParametrics Packages available on my website.
  • Previous by thread: Re: Types in Mathematica thread
  • Next by thread: Re: Types in Mathematica thread