diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2024-04-02 17:24:14 +0200 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2024-04-02 17:24:14 +0200 |
commit | 92c319247fae9d8be3f3291d6fa64266224ef61c (patch) | |
tree | 58c6a23c5117310ca18fda3c3813516271b6f343 /factorial.hpp | |
parent | a0d936b498735569c6570b020b47d0430883406b (diff) | |
download | code-92c319247fae9d8be3f3291d6fa64266224ef61c.tar.gz code-92c319247fae9d8be3f3291d6fa64266224ef61c.tar.bz2 code-92c319247fae9d8be3f3291d6fa64266224ef61c.zip |
Added tensor support.
Diffstat (limited to 'factorial.hpp')
-rw-r--r-- | factorial.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/factorial.hpp b/factorial.hpp new file mode 100644 index 0000000..ddc0bac --- /dev/null +++ b/factorial.hpp @@ -0,0 +1,9 @@ +#pragma once + +long unsigned factorial(unsigned p) { + if (p == 0) { + return 1; + } else { + return p * factorial(p - 1); + } +} |