MathGroup Archive 2005

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

Search the Archive

Re: Types in Mathematica thread


Bill Rowe wrote:
> But it is easily added should you want a test for reals using the
> same syntax, e.g.,
> 
> RealQ[x_]:=Element[x,Reals]
> 
> will do the trick quite nicely.

You may also want:

  RealQ[x_] := Element[x,Reals] === True

to guarantee a boolean result, or:

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

for equivalence with the Head test "_Real", rather than the mathematical
concept of a real number.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/ocaml_for_scientists/chapter1.html


  • Prev by Date: Re: Types in Mathematica
  • Next by Date: Bug in Graphics output of Circle primitive?
  • Previous by thread: Re: Re: Types in Mathematica thread
  • Next by thread: Re: Re: Types in Mathematica thread