|
[Date Index]
[Thread Index]
[Author Index]
Re: how to pull real numbers out of a linear funktion ?
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
Prev by Date:
Re: Help
Next by Date:
Mathematica for Linux on Alpha?
Prev by thread:
RE: how to pull real numbers out of a linear funktion ?
Next by thread:
Re: how to pull real numbers out of a linear funktion ?
|