6 lines
109 B
Text
6 lines
109 B
Text
static function factorial(n:Int):Int {
|
|
var result = 1;
|
|
while (1<n)
|
|
result *= n--;
|
|
return result;
|
|
}
|