module
abs()Constexpr-friendly alternatives to std::abs.
Functions
- auto abs(half x) -> half constexpr noexcept
- Returns the absolute value of a half-precision float.
- auto abs(float x) -> float constexpr noexcept
- Returns the absolute value of a float.
- auto abs(double x) -> double constexpr noexcept
- Returns the absolute value of a double.
- auto abs(long double x) -> long double constexpr noexcept
- Returns the absolute value of a long double.
- auto abs(float128_t x) -> float128_t constexpr noexcept
- Returns the absolute value of a float128_t.
- auto abs(_Float16 x) -> _Float16 constexpr noexcept
- Returns the absolute value of a _Float16.
- auto abs(signed char x) -> signed char constexpr noexcept
- Returns the absolute value of a signed char.
- auto abs(short x) -> short constexpr noexcept
- Returns the absolute value of a short.
- auto abs(int x) -> int constexpr noexcept
- Returns the absolute value of an int.
- auto abs(long x) -> long constexpr noexcept
- Returns the absolute value of a long.
- auto abs(long long x) -> long long constexpr noexcept
- Returns the absolute value of a long long.
-
template <typename T>auto abs(T x) -> T constexpr noexcept
- Returns the absolute value of an integral type.
-
template <typename S, size_t D>auto abs(const vector<S, D>& v) -> vector<S, D> constexpr noexcept
- Returns a copy of a vector with all scalar components set to their absolute values.
Function documentation
half abs(half x) constexpr noexcept
#include <muu/half.h>
Returns the absolute value of a half-precision float.
float abs(float x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of a float.
double abs(double x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of a double.
long double abs(long double x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of a long double.
float128_t abs(float128_t x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of a float128_t.
_Float16 abs(_Float16 x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of a _Float16.
signed char abs(signed char x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of a signed char.
short abs(short x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of a short.
int abs(int x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of an int.
long abs(long x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of a long.
long long abs(long long x) constexpr noexcept
#include <muu/math.h>
Returns the absolute value of a long long.
#include <muu/math.h>
template <typename T>
T abs(T x) constexpr noexcept
Returns the absolute value of an integral type.