Re: Boolean Type
- To: mathgroup at smc.vnet.net
- Subject: [mg52438] Re: [mg52415] Boolean Type
- From: Selwyn Hollis <sh2.7183 at misspelled.erthlink.net>
- Date: Sat, 27 Nov 2004 01:40:36 -0500 (EST)
- References: <200411260604.BAA24200@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
You've got it right in the Real case, although you might want
f[x_?NumericQ]
instead. If by 'boolean variable' you mean one that has values in
{True, False}, then this will do the trick:
f[x_?(MemberQ[{True, False}, #] &)]
-----
Selwyn Hollis
http://www.appliedsymbols.com
(edit reply-to to reply)
On Nov 26, 2004, at 1:04 AM, JMyers6761 wrote:
> All,
> I would like to define a function wich would work (in different ways)
> for both
> real and boolean input argruments. How should I best implement a
> function which
> would implement the following intent?
>
> func[x_Real]:= some function involving a real varialble x
>
> func[x_Boolean]:= some function involving a boolean variable x
>
> Thanks for any help.
>
> Al Myers
>
>
>
>
- References:
- Boolean Type
- From: jmyers6761@aol.com (JMyers6761)
- Boolean Type