remove math
This commit is contained in:
@ -1,26 +0,0 @@
|
|||||||
#include "MyMath.h"
|
|
||||||
|
|
||||||
// NOTE: I added this file
|
|
||||||
|
|
||||||
int mmath::min(int a, int b) {
|
|
||||||
if (a < b) { return a; }
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
|
|
||||||
int mmath::max(int a, int b) {
|
|
||||||
if (a < b) { return b; }
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
int mmath::abs(int a) {
|
|
||||||
if (a < 0) { return -a; }
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
int mmath::pow(int a, unsigned int b) {
|
|
||||||
int result = 1;
|
|
||||||
for (unsigned int i = 0; i < b; ++i) {
|
|
||||||
result = result * a;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
#ifndef __MYMATH_INCLUDE_H_
|
|
||||||
#define __MYMATH_INCLUDE_H_
|
|
||||||
|
|
||||||
// NOTE: I added this file
|
|
||||||
|
|
||||||
namespace mmath {
|
|
||||||
int min(int, int);
|
|
||||||
int max(int, int);
|
|
||||||
int abs(int);
|
|
||||||
int pow(int, unsigned int);
|
|
||||||
} // namespace mmath
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Reference in New Issue
Block a user