MathGroup Archive 2005

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

Search the Archive

Re: Re: Types in Mathematica thread


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