Math » floor() module

Constexpr-friendly alternatives to std::floor.

Functions

auto floor(half x) -> half constexpr noexcept
Returns the floor of a half-precision float.
auto floor(float x) -> float constexpr noexcept
Returns the floor of a float value.
auto floor(double x) -> double constexpr noexcept
Returns the floor of a double value.
auto floor(long double x) -> long double constexpr noexcept
Returns the floor of a long double value.
auto floor(float128_t x) -> float128_t constexpr noexcept
Returns the floor of a float128_t value.
auto floor(_Float16 x) -> _Float16 constexpr noexcept
Returns the floor of a _Float16 value.
template <typename T>
auto floor(T x) -> double constexpr noexcept
Returns the floor of an integer.
template <typename S, size_t D>
auto floor(const vector<S, D>& v) -> vector<S, D> constexpr noexcept
Returns a copy of a vector with all scalar components set to the highest integer not greater than their original values.

Function documentation

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

Returns the floor of a half-precision float.

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

Returns the floor of a float value.

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

Returns the floor of a double value.

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

Returns the floor of a long double value.

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

Returns the floor of a float128_t value.

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

Returns the floor of a _Float16 value.

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

Returns the floor of an integer.

template <typename S, size_t D>
vector<S, D> floor(const vector<S, D>& v) constexpr noexcept

Returns a copy of a vector with all scalar components set to the highest integer not greater than their original values.