Re: Function definition
- To: mathgroup at smc.vnet.net
- Subject: [mg18218] Re: Function definition
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Tue, 22 Jun 1999 20:41:12 -0400
- Organization: Universitaet Leipzig
- References: <7kmtmi$230@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, this depends on your understanding of "Real". If you mean it like a C type that is not possible you can restrict the head like f[x_Real]:= ... but it may be better use f[x_?NumericQ]:= .. so that f[1/2] and f[Pi] is also working. Hope that helps Jens 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 bqto.unexpo.edu.ve