Mutual recursion: Difference between revisions

Content deleted Content added
Ruud Koot (talk | contribs)
[http://rosettacode.org/wiki/Mutual_recursion Mutual recursion] at Rosetta Code
m Example: Make explanation of example clearer.
Line 22:
'''return''' even?(abs(number)-1)
 
These functions are based on the realization that the question ''is three3 even?'' is equivalent to the question, ''is two2 odd?'', which is theequivalent sameto as''is asking1 ifeven?'', 1which is evenequivalent or 0to ''is 0 odd.?''; Inand the end,answer theto answerthat is no,defined as realized by the function <code>odd?false</code>. The <code>abs</code> function is used to ensureensures that <code>number</code> decrementsis towardspositive, zeroso eventhat whensubtracting it1 startsevery offtime asis aguaranteed negativeto valuelead towards 0, not away from it.
 
== Conversion to direct recursion ==