Factorial: Difference between revisions

Content added Content deleted
(Replace println() with print(); replace output "syntaxhighlight" tag with "pre" tag)
Line 3,750:
// 128-bit test
UInt128 bigNum = 34;
console.printlnprint($"factorial({bigNum})={factorial(bigNum)}");
 
// 64-bit test
for (Int i : 10..-1)
{
console.printlnprint($"factorial({i})={factorial(i)}");
}
}
Line 3,761:
</syntaxhighlight>
 
{{out}}
Output:
<pre>
<syntaxhighlight>
factorial(34)=295232799039604140847618609643520000000
factorial(10)=3628800
Line 3,775:
factorial(1)=1
factorial(0)=0
 
</syntaxhighlight>
2023-01-19 10:14:52.716 Service "ShowFactorials" (id=1) at ^ShowFactorials (CallLaterRequest: native), fiber 1: Unhandled exception: IllegalArgument: "n >= Value.zero()": n=-1, Value.zero()=0, Value=Int
at factorial(Type<IntNumber>, factorial(?)#Value) (test.x:5)
at run() (test.x:19)
at ^ShowFactorials (CallLaterRequest: native)
</pre>
 
=={{header|EGL}}==