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
8
namespace
sil
{
9
10
namespace
misc {
11
12
// From https://stackoverflow.com/a/44719219
13
constexpr
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
sil::misc::factorial
constexpr std::size_t factorial(std::size_t k) noexcept
Definition
factorial.hpp:13
sil
The top-level namespace of SimiLie.
Definition
csr.hpp:14
include
similie
misc
factorial.hpp
Generated by
1.12.0