cgul_log2.h File Reference

log2() More...

#include "cgul_common.h"
#include "cgul_exception.h"
Include dependency graph for cgul_log2.h:
This graph shows which files directly or indirectly include this file:

Functions

CGUL_BEGIN_C CGUL_EXPORT int cgul_log2__floor (cgul_exception_t *cex, unsigned long int n)
 
CGUL_EXPORT int cgul_log2__ceil (cgul_exception_t *cex, unsigned long int n)
 

Detailed Description

log2(). Calculate the floor and ceiling of the base-2 logarithm of unsigned long types.

Author
Paul Serice

Function Documentation

§ cgul_log2__floor()

CGUL_BEGIN_C CGUL_EXPORT int cgul_log2__floor ( cgul_exception_t cex,
unsigned long int  n 
)

Return the floor of the base-2 logarithm of the number n. If n is zero, an exception is thrown.

Parameters
[in,out]cexc-style exception
[in]nnumber
Returns
floor(log2(n))

Referenced by cgul_log2_cxx::floor().

§ cgul_log2__ceil()

CGUL_EXPORT int cgul_log2__ceil ( cgul_exception_t cex,
unsigned long int  n 
)

Return the ceiling of the base-2 logarithm of the number n. If n is zero, an exception is thrown.

Parameters
[in,out]cexc-style exception
[in]nnumber
Returns
ceil(log2(n))

Referenced by cgul_log2_cxx::ceil().