ape  0.5.0
Audio Programming Environment
Namespaces | Functions
mathutil.h File Reference
#include <cmath>
#include <algorithm>

Go to the source code of this file.

Namespaces

 ape
 

Functions

std::size_t ape::clamp_available (std::size_t position, std::size_t size, std::size_t available)
 Step N towards size given available "samples", if at position sample. This is a useful utility to count towards a task to be done every size samples, given variably sized sample inputs. More...
 
size_t ape::nextpow2 (size_t current)
 Returns the next power of two, or equivalent to current More...
 
size_t ape::nextpow2above (size_t current)
 Returns the next power of two, above current More...
 
template<typename UIntType >
std::enable_if< std::is_unsigned< UIntType >::value, bool >::type ape::ispow2 (UIntType t)
 Tests whether t is a power of two. More...