Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: Function definition

  • To: mathgroup at
  • Subject: [mg18215] Re: Function definition
  • From: Murray Eisenberg <murray at>
  • Date: Tue, 22 Jun 1999 20:41:11 -0400
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <7kmtmi$>
  • Sender: owner-wri-mathgroup at

In Mathematica 4, for example:

   f[x_ /; x \[Element] Reals] := x^2




   f[2 + 3 I]
f[2 + 3 I]

Of course, one would probably enter the condition on x in the form Esc
elem Esc to produce an actual epsilon-like "element-of" symbol in
StandardInput form.

Jesus Perez Ortega wrote:
> Hi All,
> How can I restrict a variable to be Real in the function definition?
> Regards
> --
> Jesus Perez Ortega
> jesper at

Murray Eisenberg                     murray at
Mathematics & Statistics Dept.       phone 413 549-1020 (H)
Univ. of Massachusetts                     413 545-2859 (W)
Amherst, MA 01003-4515

  • Prev by Date: Re: Scoping and named patterns
  • Next by Date: Re: Some problems with complex functions like Sqrt[z]
  • Previous by thread: Re: Function definition
  • Next by thread: Re: Re: Function definition