micro-test-plus 3.2.2
µTest++ Testing Framework
Loading...
Searching...
No Matches
math.h File Reference

C++ header file with declarations for the µTest++ mathematical utilities. More...

#include <array>

Go to the source code of this file.

Namespaces

namespace  micro_os_plus
 The primary namespace for the µOS++ framework.
namespace  micro_os_plus::micro_test_plus
 Primary namespace for the µTest++ testing framework.
namespace  micro_os_plus::micro_test_plus::math
 Mathematical utilities for the µTest++ testing framework.

Functions

template<class T>
constexpr auto micro_os_plus::micro_test_plus::math::abs (const T t) -> T
 Computes the absolute value of a given comparable value.
template<class T, char... Cs>
constexpr auto micro_os_plus::micro_test_plus::math::den (void) -> T
 Computes the decimal part of a number represented as an array of characters.
template<class T, class Value_T>
constexpr auto micro_os_plus::micro_test_plus::math::den_size (Value_T value) -> T
 Computes the number of decimal places of a value, up to 7 digits.
template<class T, char... Cs>
constexpr auto micro_os_plus::micro_test_plus::math::den_size (void) -> T
 Computes the number of decimal places in a number represented as an array of characters.
template<class T>
constexpr auto micro_os_plus::micro_test_plus::math::min_value (const T &lhs, const T &rhs) -> const T &
 Computes the minimum of two comparable values.
template<class T, char... Cs>
constexpr auto micro_os_plus::micro_test_plus::math::num (void) -> T
 Computes the integral value of a number represented as an array of characters.
template<class T, class Exp_T>
constexpr auto micro_os_plus::micro_test_plus::math::pow (const T base, const Exp_T exp) -> T
 Generic exponentiation function to compute the power of a base raised to an exponent.

Detailed Description

This header provides the declarations for the mathematical utility templates used within the µTest++ framework. It defines interfaces for a suite of constexpr mathematical functions, including absolute value, minimum value selection, exponentiation, and compile-time parsing of numeric values from character sequences.

These utilities are designed to be lightweight and suitable for embedded environments, supporting both integral and floating-point types, and enabling expressive, type-safe, and efficient compile-time computations. Special attention is given to constexpr compatibility and minimal reliance on the standard library, ensuring portability and performance across a wide range of platforms.

All definitions reside within the micro_os_plus::micro_test_plus::math namespace, ensuring clear separation from user code and minimising the risk of naming conflicts.

The header files are organised within the include/micro-os-plus/micro-test-plus folder to maintain a structured and modular codebase.

This file is intended solely for internal use within the framework and should not be included directly by user code.

Definition in file math.h.