The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
mha_error_helpers Namespace Reference

Functions

unsigned digits (unsigned n)
 Compute number of decimal digits required to represent an unsigned integer. More...
 
unsigned snprintf_required_length (const char *formatstring,...)
 snprintf_required_length Compute the number of bytes (excluding the terminating nul) required to store the result of an snprintf. More...
 

Function Documentation

◆ digits()

unsigned mha_error_helpers::digits ( unsigned  n)

Compute number of decimal digits required to represent an unsigned integer.

Parameters
nThe unsigned integer that we want to know the number of required decimal digits for. return The number of decimal digits in n.

◆ snprintf_required_length()

unsigned mha_error_helpers::snprintf_required_length ( const char *  formatstring,
  ... 
)

snprintf_required_length Compute the number of bytes (excluding the terminating nul) required to store the result of an snprintf.

Parameters
formatstringThe format string with standard printf formatstring
Returns
the number of bytes required by printf without the terminating nul