WPILibC++
2025.1.1
Loading...
Searching...
No Matches
fabsf.hpp
Go to the documentation of this file.
1
/*################################################################################
2
##
3
## Copyright (C) 2016-2024 Keith O'Hara
4
##
5
## This file is part of the GCE-Math C++ library.
6
##
7
## Licensed under the Apache License, Version 2.0 (the "License");
8
## you may not use this file except in compliance with the License.
9
## You may obtain a copy of the License at
10
##
11
## http://www.apache.org/licenses/LICENSE-2.0
12
##
13
## Unless required by applicable law or agreed to in writing, software
14
## distributed under the License is distributed on an "AS IS" BASIS,
15
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
## See the License for the specific language governing permissions and
17
## limitations under the License.
18
##
19
################################################################################*/
20
21
#ifndef _gcem_fabsf_HPP
22
#define _gcem_fabsf_HPP
23
24
namespace
gcem
25
{
26
27
/**
28
* Compile-time floating-point absolute value function
29
*
30
* @param x a real-valued input.
31
* @return the absolute value of \c x, \f$ |x| \f$, where the return type is a floating point number (float only).
32
*/
33
34
template
<
typename
T>
35
constexpr
36
float
37
fabsf
(
const
T x)
38
noexcept
39
{
40
return
gcem::abs
(
static_cast<
float
>
(x) );
41
}
42
43
}
44
45
#endif
gcem
Definition
is_odd.hpp:29
gcem::abs
constexpr T abs(const T x) noexcept
Compile-time absolute value function.
Definition
abs.hpp:40
gcem::fabsf
constexpr float fabsf(const T x) noexcept
Compile-time floating-point absolute value function.
Definition
fabsf.hpp:37
thirdparty
gcem
include
gcem_incl
fabsf.hpp
Generated on Thu Jan 2 2025 00:19:44 for WPILibC++ by
1.12.0