2016-12-05 22:15:40 +01:00
;Definitions:
2017-09-23 10:01:46 +02:00
:* The factorial of '''0''' (zero) is [[wp:Factorial#Definition|defined]] as being 1 (unity).
2016-12-05 22:15:40 +01:00
:* The '''Factorial Function''' of a positive integer, <big> ''n'', </big> is defined as the product of the sequence:
<big><big> ''n'', ''n''-1, ''n''-2, ... 1 </big></big>
2013-04-10 21:29:02 -07:00
2016-12-05 22:15:40 +01:00
;Task:
2015-02-20 00:35:01 -05:00
Write a function to return the factorial of a number.
2016-12-05 22:15:40 +01:00
2015-02-20 00:35:01 -05:00
Solutions can be iterative or recursive.
2016-12-05 22:15:40 +01:00
Support for trapping negative <big> ''n'' </big> errors is optional.
2018-06-22 20:57:24 +00:00
;Related task:
* [[Primorial numbers]]
2016-12-05 22:15:40 +01:00
<br><br>