Static Public Member Functions | |
| static | play ($n) |
Class of the math fatorial function to be used into the sequence diagram
Definition at line 15 of file Fatorial.php.
| static play | ( | $ | n | ) | [static] |
calc the fatorial of the value received
| integer | $n |
Definition at line 26 of file Fatorial.php.
00027 { 00028 if( $n < 0 ) 00029 { 00030 throw new Exception( "invalid factorial value" ); 00031 } 00032 00033 if ( $n == 0 ) 00034 { 00035 return 1; 00036 } 00037 else 00038 { 00039 return $n * self::play( $n - 1 ); 00040 } 00041 }
1.5.9