sm::cem
constexpr maths functions
#include <sm/constexpr_math>
Header file: <sm/constexpr_math>.
Table of Contents
Summary
constexpr capable basic maths functions that will work in your C++20 and C++23 programs. Eventually, these functions will all be superceded by C++26 functions in the std namespace.
This file is about 700 lines of cherry-picked code from Keith O’Hara’s GCE Math library (thanks Keith!).
Usage
Use the functions just like their std:: equivalents, but optionally in your constexpr functions.
The functions provided are:
sm::cem::absmaps tostd::abssm::cem::isinfmaps tostd::isinfsm::cem::isfinitemaps tostd::isfinitesm::cem::sqrtmaps tostd::sqrtsm::cem::powmaps tostd::powsm::cem::expmaps tostd::expsm::cem::logmaps tostd::logsm::cem::log10maps tostd::log10sm::cem::signbitmaps tostd::signbitsm::cem::sgnis the signum function (bonus)sm::cem::ceilmaps tostd::ceil(already constexpr in C++23)sm::cem::floormaps tostd::floor(already constexpr in C++23)sm::cem::truncmaps tostd::trunc(already constexpr in C++23)sm::cem::roundmaps tostd::round(already constexpr in C++23)sm::cem::sinmaps tostd::sinsm::cem::cosmaps tostd::cossm::cem::tanmaps tostd::tansm::cem::asinmaps tostd::asinsm::cem::acosmaps tostd::acossm::cem::atanmaps tostd::atansm::cem::atan2maps tostd::atan2