Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_Math.h File Reference
#include <algorithm>
Include dependency graph for cs_Math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CsMath::Interval< T, S >
 Represents an interval by two unsigned integers [base, base + diff]. More...
 

Namespaces

namespace  CsMath
 

Functions

template<class T , class U >
constexpr T CsMath::SafeAdd (T lhs, U rhs)
 returns lhs+rhs, clamping return values that would roll over to the min/max values of lhs. More...
 
template<class T , class U = int>
constexpr T & CsMath::Increase (T &obj, U diff=1)
 roll over safe variant of ++some_value; More...
 
template<class T , class U = int>
constexpr T & CsMath::Decrease (T &obj, U diff=1)
 roll over safe variant of –some_value; More...
 
template<class T , class M , class U = int>
constexpr decltype(auto) CsMath::DecreaseMember (T &obj, M member, U diff=1)
 Identical to the other decrease function. More...
 
template<class T , class S >
auto CsMath::mod (T v, S m) -> decltype(v % m)
 Returns the canonical representation of [v] considered as element of Z/mZ, regardless of any silly features C++ board thought that would be better than actual math when using non-positive input. More...
 
template<class T , class S >
auto CsMath::min (T l, S r)
 
template<class T , class S >
auto CsMath::max (T l, S r)
 
template<class V , class L , class U >
auto CsMath::clamp (V value, L lower, U upper)
 Returns: More...
 
template<class T >
CsMath::round (float val)
 Rounds a numeric value. More...