Run timing loops over the following factorial calculator algorirhms to determine which is fastest.
- Iterative.
- Recursive.
- Unrolled Loop.
- Table Lookup.
CF.Factorial.Timings
C Version: 201710
Iterative:
20!: 2432902008176640000, overflow: false
CPU Time = 0.445689 s
Recursive:
20!: 2432902008176640000, overflow: false
CPU Time = 0.629249 s
Unrolled:
20!: 2432902008176640000, overflow: false
CPU Time = 0.141881 s
Tabular:
20!: 2432902008176640000, overflow: false
CPU Time = 0.017959 s
Program ended with exit code: 0