A simple factorial function, it will assert the value type and the value itself