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
// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4
#
ifndef
TETL_MATH_SIGN_HPP
5
#
define
TETL_MATH_SIGN_HPP
6
7
namespace
etl
::detail {
8
9
template
<
typename
T>
10
[[nodiscard]]
constexpr
auto
sign(T val)
11
{
12
if
(val < 0) {
13
return
T(-1);
14
}
15
return
T(1);
16
}
17
}
// namespace etl::detail
18
19
#
endif
// TETL_MATH_SIGN_HPP
etl
Definition
adjacent_find.hpp:9
include
etl
_math
sign.hpp
Generated on Sun Sep 7 2025 19:15:09 for tetl by
1.9.8