summaryrefslogtreecommitdiffstats
path: root/dbug/factorial.c
blob: e1cb77f0e302be4796ed59a3eab9d94f2f76c8f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <my_global.h>

int factorial (
register int value)
{
    DBUG_ENTER ("factorial");
    DBUG_PRINT ("find", ("find %d factorial", value));
    if (value > 1) {
	value *= factorial (value - 1);
    }
    DBUG_PRINT ("result", ("result is %d", value));
    DBUG_RETURN (value);
}