18 lines
252 B
C
18 lines
252 B
C
|
|
#ifndef _MATH_H
|
||
|
|
#define _MATH_H
|
||
|
|
|
||
|
|
#include <types.h>
|
||
|
|
|
||
|
|
bool is_low_power_of_two(int n);
|
||
|
|
|
||
|
|
uint64_t int_pow(uint64_t base, uint32_t exp);
|
||
|
|
|
||
|
|
/* Divide a by b, rounding up */
|
||
|
|
static inline int div_round_up(int a, int b)
|
||
|
|
{
|
||
|
|
return (a + b - 1) / b;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
#endif
|