https://github.com/rshipp/math-c
A few simple math-related C and C++ programs.
https://github.com/rshipp/math-c
c continued-fractions factorial math
Last synced: 11 months ago
JSON representation
A few simple math-related C and C++ programs.
- Host: GitHub
- URL: https://github.com/rshipp/math-c
- Owner: rshipp
- Created: 2012-02-29T22:00:40.000Z (over 14 years ago)
- Default Branch: main
- Last Pushed: 2020-06-14T23:53:33.000Z (about 6 years ago)
- Last Synced: 2025-06-08T22:13:51.758Z (about 1 year ago)
- Topics: c, continued-fractions, factorial, math
- Language: C
- Homepage: http://rshipp.github.io/math-c
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Just a few simple math-related C and C++ programs and functions.
These are written extremely pedantically in either Allman or OTB
styles, with 2-space or 4-space indentation.
#### Benchmarks for the factorial functions
##### Recursive factorial_r(12), 100,000,000 iterations
real 0m6.067s
user 0m5.861s
sys 0m0.039s
##### For-loop factorial_f(12), 100,000,000 iterations
real 0m4.656s
user 0m4.596s
sys 0m0.030s
##### Recursive factorial_r(3), 100,000,000 iterations
real 0m1.248s
user 0m1.231s
sys 0m0.009s
##### For-loop factorial_f(3), 100,000,000 iterations
real 0m0.918s
user 0m0.735s
sys 0m0.007s