tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
sign.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_MATH_SIGN_HPP
4
#define TETL_MATH_SIGN_HPP
5
6
namespace
etl::detail {
7
8
template
<
typename
T>
9
[[nodiscard]]
constexpr
auto
sign(T val)
10
{
11
if
(val < 0) {
12
return
T(-1);
13
}
14
return
T(1);
15
}
16
}
// namespace etl::detail
17
18
#endif
// TETL_MATH_SIGN_HPP
include
etl
_math
sign.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0