2000-07-31 21:29:14 +02:00
|
|
|
#ifdef DBUG_OFF /* We are testing dbug */
|
2007-01-27 22:07:52 +01:00
|
|
|
|
|
|
|
int factorial(register int value) {
|
|
|
|
if(value > 1) {
|
|
|
|
value *= factorial(value-1);
|
|
|
|
}
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
2000-07-31 21:29:14 +02:00
|
|
|
|
2001-09-14 01:54:33 +02:00
|
|
|
#include <my_global.h>
|
2000-07-31 21:29:14 +02:00
|
|
|
|
2001-08-22 00:45:07 +02:00
|
|
|
int factorial (
|
|
|
|
register int value)
|
2000-07-31 21:29:14 +02:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
2007-01-27 22:07:52 +01:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|