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

7 lines
109 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
static function factorial(n:Int):Int {
var result = 1;
while (1<n)
result *= n--;
return result;
}