dot-xx
A personal collection of small C++ modules
|
Miscellaneous math facilities. More...
Enumerations | |
enum class | dxx::math::Sign : int { Positive = 1 , Zero = 0 , Negative = -1 } |
Return type of sign. Use std::to_underlying to convert to int |
Functions | |
template<typename T, typename Compare = std::less<T>, typename Diff = Sub> | |
constexpr T | dxx::math::abs_diff (const T &a, const T &b, Compare comp={}, Diff diff={}) |
Underflow-safe absolute difference between two numbers. | |
template<typename T, typename Less = std::less<T>> | |
constexpr Sign | dxx::math::sign (T t, Less less={}, T zero={}) |
Gets the sign of a number. |
Miscellaneous math facilities.
Files | |
file | /build-llvm-libcpp/_deps/dot-xx-math-src/src/utils/utils.xx |
Main interface file for the dxx.math.utils module. | |
file | /build-llvm-libcpp/_deps/dot-xx-math-src/src/utils/abs_diff.xx |
Absolute difference between two numbers. | |
file | /build-llvm-libcpp/_deps/dot-xx-math-src/src/utils/sign.xx |
Number sign. |