MathGroup Archive 1999

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

Search the Archive

Double evaluation in recursive function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19510] Double evaluation in recursive function
  • From: "Benoit Debaque" <bdebaque at cybercable.fr>
  • Date: Sat, 28 Aug 1999 15:53:26 -0400
  • Organization: Labo SIP, Univ Paris V
  • Sender: owner-wri-mathgroup at wolfram.com

Hi all !

Does somebody know how to use 2 calls at a time in a recursive function...?

for example I want to evaluate the following

myf[x_] : =  If[ x > 5, i = x ; j = x ; i--; j--; myf[i]; myf[j] ]

I get the answer from
myf[7]

i=6
i=5
j=5
j=5

apparently Mathematica doesn't like much the second term myf[j], because it
start from 5 to 5 ! and not from 6 to 5 like variable i............how can I
manage such a problem ?

Thanx for any suggestion or advice.

Benoit.

--
----------------------------------------------------------------------------
-
Laboratoire des Systèmes Intelligents de Perceptions
UFR Mathématiques-Informatique
Phone: 01-41-48-08-55 / 01-44-55-35-58
web site: http://www.math-info.univ-paris5.fr/sip-lab/sip1.html
---------------------------------------------------------------------------





  • Prev by Date: Cleveland's algorithms
  • Next by Date: Stochastic differential equations
  • Previous by thread: Cleveland's algorithms
  • Next by thread: Stochastic differential equations