The factorial of self (aka self!)

Returns 1 * 2 * 3 * ... * self-1 * self

assert 0.factorial == 1  # by convention for an empty product
assert 1.factorial == 1
assert 4.factorial == 24
assert 9.factorial == 362880

Property definitions

core :: math $ Int :: factorial
	# The factorial of `self` (aka `self!`)
	#
	# Returns `1 * 2 * 3 * ... * self-1 * self`
	#
	#     assert 0.factorial == 1  # by convention for an empty product
	#     assert 1.factorial == 1
	#     assert 4.factorial == 24
	#     assert 9.factorial == 362880
	fun factorial: Int
	do
		assert self >= 0
		var res = 1
		var n = self
		while n > 0 do
			res = res * n
			n -= 1
		end
		return res
	end
lib/core/math.nit:153,2--171,4