SimiLie
Loading...
Searching...
No Matches
factorial.hpp
1// SPDX-FileCopyrightText: 2024 Baptiste Legouix
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include <ddc/ddc.hpp>
7
8namespace sil {
9
10namespace misc {
11
12// From https://stackoverflow.com/a/44719219
13constexpr inline std::size_t factorial(std::size_t k) noexcept
14{
15 return (k <= 1) ? 1 : k * factorial(k - 1);
16}
17
18} // namespace misc
19
20} // namespace sil
constexpr std::size_t factorial(std::size_t k) noexcept
Definition factorial.hpp:13
The top-level namespace of SimiLie.
Definition csr.hpp:14