On Feb 2, 2006, at 10:48 AM, Phil M wrote:

Here is a very simple one:

  Function PowerTo(x As Integer, n As Integer) As Integer
    If (n <= 1) Then Return 1
    Return x * PowerTo(x, n - 1)
  End Function

Sorry, that should be:

  Function PowerTo(x As Integer, n As Integer) As Integer
    If (n <= 0) Then
      Return 1
    Elseif (n = 1) Then
      Return x
    Else
      Return x * PowerTo(x, n - 1)
    End If
  End Function

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to