mirror of
https://github.com/drasko/codezero.git
synced 2026-02-20 05:43:15 +01:00
Kernel updates since December 2009
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
#ifndef __LIB_MATH_H__
|
||||
#define __LIB_MATH_H__
|
||||
|
||||
/* Take the power */
|
||||
static inline int pow(int val, int exp)
|
||||
{
|
||||
int res = 1;
|
||||
|
||||
for (int i = 0; i < exp; i++)
|
||||
res *= val;
|
||||
return res;
|
||||
}
|
||||
|
||||
static inline int min(int x, int y)
|
||||
{
|
||||
return x < y ? x : y;
|
||||
|
||||
Reference in New Issue
Block a user