Math » cos() module

Constexpr-friendly alternatives to std::cos.

Functions

auto cos(half x) -> half constexpr noexcept
Returns the cosine of a half-precision float.
auto cos(float x) -> float constexpr noexcept
Returns the cosine of a float.
auto cos(double x) -> double constexpr noexcept
Returns the cosine of a double.
auto cos(long double x) -> long double constexpr noexcept
Returns the cosine of a long double.
auto cos(float128_t x) -> float128_t constexpr noexcept
Returns the cosine of a float128_t.
auto cos(_Float16 x) -> _Float16 constexpr noexcept
Returns the cosine of a _Float16.
template <typename T>
auto cos(T x) -> double constexpr noexcept
Returns the cosine of an integer.

Function documentation

half cos(half x) constexpr noexcept
#include <muu/half.h>

Returns the cosine of a half-precision float.

float cos(float x) constexpr noexcept
#include <muu/math.h>

Returns the cosine of a float.

double cos(double x) constexpr noexcept
#include <muu/math.h>

Returns the cosine of a double.

long double cos(long double x) constexpr noexcept
#include <muu/math.h>

Returns the cosine of a long double.

float128_t cos(float128_t x) constexpr noexcept
#include <muu/math.h>

Returns the cosine of a float128_t.

_Float16 cos(_Float16 x) constexpr noexcept
#include <muu/math.h>

Returns the cosine of a _Float16.

#include <muu/math.h>
template <typename T>
double cos(T x) constexpr noexcept

Returns the cosine of an integer.