Factorial: Difference between revisions

Add Ecstasy example
No edit summary
(Add Ecstasy example)
Line 3,680:
→ 3628800.0000000005
</syntaxhighlight>
 
=={{header|Ecstasy}}==
<syntaxhighlight lang="java">module ShowFactorials
{
static Int factorial(Int n)
{
assert:arg n >= 0;
return n <= 1 ? n : n * factorial(n-1);
}
 
@Inject Console console;
void run()
{
for (Int i : 10..-1)
{
console.println($"factorial({i})={factorial(i)}");
}
}
}</syntaxhighlight>
 
=={{header|EGL}}==
162

edits