diff --git a/os/zmath.cpp b/os/zmath.cpp new file mode 100644 index 0000000..e69de29 diff --git a/os/zmath.hpp b/os/zmath.hpp new file mode 100644 index 0000000..5089e9b --- /dev/null +++ b/os/zmath.hpp @@ -0,0 +1,8 @@ +#pragma once +#include +namespace iflytop { +using namespace std; +static inline float zfabs(float a) { return a > 0 ? a : -a; } +static inline bool zfeq(float a, float b, float eps) { return zfabs(a - b) < eps; } + +} // namespace iflytop \ No newline at end of file diff --git a/os/zos.hpp b/os/zos.hpp index 6f624cc..27e7091 100644 --- a/os/zos.hpp +++ b/os/zos.hpp @@ -15,6 +15,8 @@ #include "zos_thread.hpp" // #include "zos_schduler.hpp" +// +#include "zmath.hpp" extern "C" { typedef struct { uint32_t __reserved0;