RosettaCodeData/Task/Factorial/PowerShell/factorial-3.ps1
2026-04-30 12:34:36 -04:00

6 lines
124 B
PowerShell

function Get-Factorial ($x) {
if ($x -eq 0) {
return 1
}
return (Invoke-Expression (1..$x -join '*'))
}