MathGroup Archive 1998

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

Search the Archive

RE: how to pull real numbers out of a linear funktion ?


  • To: mathgroup@smc.vnet.net
  • Subject: [mg11147] RE: [mg11092] how to pull real numbers out of a linear funktion ?
  • From: "Barthelet, Luc" <lucb@ea.com>
  • Date: Mon, 23 Feb 1998 21:41:05 -0500

you might want to try something like this.

f[c_Real, x_] := c f[x] ;
f[c_Integer, x_] := c f[x] ;
f[c_ /;(Im[c]!=0),x_] := -c f[x];

I then got:
f[3,4]
3 f[4]

f[3+5I,5]
(-3-5 I) f[5]

Good Luck!

Luc Barthelet

>-----Original Message-----
>From:	Roland Bollmann [SMTP:roland@arnold.fkp.physik.th-darmstadt.de]
To: mathgroup@smc.vnet.net
>Sent:	Sunday, February 22, 1998 11:55 AM
>To:	mathgroup@smc.vnet.net
>Subject:	[mg11092] how to pull real numbers out of a linear funktion ?
>
>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.
>
>It semms to me, that mathematica can not give a variable the   attribute
>"real number" or "complex number".
>
>But it should be easy ... somehow ;-)
>
>Roland Bollmann (student of physics)
>



  • Prev by Date: Re: Bug in SQRT function
  • Next by Date: Re: random number generation
  • Prev by thread: how to pull real numbers out of a linear funktion ?
  • Next by thread: Re: how to pull real numbers out of a linear funktion ?