From d921632038386e21b08a3251785822cfc5e0ab9f Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 18 Sep 2023 10:48:36 +0800 Subject: [PATCH] add zmath --- os/zmath.cpp | 0 os/zmath.hpp | 8 ++++++++ os/zos.hpp | 2 ++ 3 files changed, 10 insertions(+) create mode 100644 os/zmath.cpp create mode 100644 os/zmath.hpp 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;