DxLibEx
abs.hpp
Go to the documentation of this file.
1
/*=============================================================================
2
Copyright (c) 2011-2016 Bolero MURAKAMI
3
https://github.com/bolero-MURAKAMI/Sprout
4
Copyright (C) 2015-2017 DxLibEx project
5
https://github.com/Nagarei/DxLibEx/
6
7
Distributed under the Boost Software License, Version 1.0.
8
(See http://www.boost.org/LICENSE_1_0.txt)
9
=============================================================================*/
10
#ifndef DXLE_INC_MATH_ABS_HPP_
11
#define DXLE_INC_MATH_ABS_HPP_
12
#include "
dxlibex/config/defines.h
"
13
#include <cmath>
14
#include "
dxlibex/type_traits/enable_if.hpp
"
15
#include "
dxlibex/math/isnan.hpp
"
16
#include "
dxlibex/math/fabs.hpp
"
17
#ifdef DXLE_NO_CXX11_CONSTEXPR
18
namespace
dxle
{
19
namespace
math{
20
using
std::abs
;
21
}
22
using
dxle::math::abs
;
23
}
24
#else //DXLE_NO_CXX11_CONSTEXPR
25
namespace
dxle
{
26
namespace
math {
27
template<typename FloatType, enable_if_t<std::is_floating_point<FloatType>::value, std::nullptr_t> =
nullptr
>
28
inline
DXLE_CONSTEXPR
FloatType
abs
(FloatType x)
DXLE_NOEXCEPT_OR_NOTHROW
29
{
30
return
dxle::math::fabs
(x);
31
}
32
}
// namespace math
33
34
using
dxle::math::abs
;
35
}
// namespace dxle
36
#endif //DXLE_NO_CXX11_CONSTEXPR
37
#endif //DXLE_INC_MATH_ABS_HPP_
DXLE_CONSTEXPR
#define DXLE_CONSTEXPR
Definition:
suffix.hpp:21
defines.h
dxle
Definition:
cast_if.hpp:12
dxle::math::abs
DXLE_CONSTEXPR FloatType abs(FloatType x) DXLE_NOEXCEPT_OR_NOTHROW
Definition:
abs.hpp:28
dxle::math::fabs
DXLE_CONSTEXPR FloatType fabs(FloatType x) DXLE_NOEXCEPT_OR_NOTHROW
Definition:
fabs.hpp:27
isnan.hpp
DXLE_NOEXCEPT_OR_NOTHROW
#define DXLE_NOEXCEPT_OR_NOTHROW
Definition:
suffix.hpp:94
fabs.hpp
enable_if.hpp
dxlibex
math
abs.hpp
Generated on Sun Jan 1 2017 10:49:51 for DxLibEx by
1.8.12