libyggdrasil
v1.0.0
|
Commonly used math functions. More...
#include <array>
#include <cmath>
#include <numeric>
#include <type_traits>
#include <cpp/common/attributes.hpp>
#include <cpp/common/types.hpp>
Go to the source code of this file.
Namespaces | |
bsp | |
bsp::math | |
Functions | |
template<typename T > | |
constexpr T | bsp::math::clamp (T value, T min, T max) |
Clamps a input value between a min and max value. More... | |
template<typename T > | |
constexpr T | bsp::math::degreeToRadian (T deg) |
Conversion between degree and radian. More... | |
template<typename T > | |
constexpr T | bsp::math::radianToDegree (T rad) |
Conversion between radian and degree. More... | |
constexpr ALWAYS_INLINE u64 | bsp::math::operator""_kB (u64 n) |
Kibibyte literal. More... | |
constexpr ALWAYS_INLINE u64 | bsp::math::operator""_MB (u64 n) |
Mibibyte literal. More... | |
constexpr ALWAYS_INLINE u64 | bsp::math::operator""_GB (u64 n) |
Gibibyte literal. More... | |
template<u16 Polynomial = 0x8005> | |
constexpr u16 | bsp::math::crc16 (const auto &data, u16 initialValue=0x00) |
Calculates the CRC16 Checksum of the data in a container. More... | |
template<u32 Polynomial = 0x04C11DB7> | |
u32 | bsp::math::crc32 (const auto &data, u32 initialValue=0x00) |
Calculates the CRC32 Checksum of the data in a container. More... | |
constexpr ALWAYS_INLINE u8 | bsp::math::bcdToBinary (u8 bcd) |
Converts a Binary Coded Decimal value to Binary. More... | |
constexpr ALWAYS_INLINE u8 | bsp::math::binaryToBcd (u8 bin) |
Converts a Binary value to Binary Coded Decimal. More... | |
Commonly used math functions.