Re: how to pull real numbers out of a linear funktion ?
- To: mathgroup@smc.vnet.net
- Subject: [mg11143] Re: how to pull real numbers out of a linear funktion ?
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Mon, 23 Feb 1998 21:41:01 -0500
- References: <6cn8jt$bdu@smc.vnet.net>
Roland Bollmann wrote: > > I want to define a function f[x_] with the property, that > > f[c_ x_] := c f[x] whenever c is a real number > > and > > f[c_ x_] := -c f[x] whenever c is a komplex number. > Rolland, What can x be? If x is a symbol we can use In[1]:= f[c_Complex x_]:= c f[x]; In[2]:= f[c_Real x_] := -c f[x]; You might also want In[262]:= f[c_Integer x_] := -c f[x]; In[263]:= f[c_Rational x_] := -c f[x]; Other possibilities may be more complicated. -- Allan Hayes Training and Consulting Leicester, UK hay@haystack.demon.co.uk http://www.haystack.demon.co.uk voice: +44 (0)116 271 4198 fax: +44 (0)116 271 8642