RosettaCodeData/Task/Factorial/Haxe/factorial-1.haxe

7 lines
109 B
Text
Raw Permalink Normal View History

2020-02-17 23:21:07 -08:00
static function factorial(n:Int):Int {
var result = 1;
while (1<n)
result *= n--;
return result;
}