Welcome to CSC200 Lab 3
n! (read n factorial) is given by:
n!=n(n-1)(n-2)...(2)(1).
Factorials grow very large quickly and are thus difficult to find precisely. Sterling's formula is a way to approximate a factorial for large n:
.
15! (factorial) computed directly with float is: 1307674411008.000000 15! (factorial) computed directly with double float is: 1307674368000.000000 15! (factorial) computed with Sterling's formula as float is: 1300430716928.000000 15! (factorial) computed with Sterling's formula as double float is: 1300430722199.465820 The absolute value of the difference with float is: 7243694080.000000 The absolute value of the difference with double float is: 7243645800.534180