From 92c319247fae9d8be3f3291d6fa64266224ef61c Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 2 Apr 2024 17:24:14 +0200 Subject: Added tensor support. --- factorial.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 factorial.hpp (limited to 'factorial.hpp') 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); + } +} -- cgit v1.2.3-70-g09d2