Level von mcsilver -- braucht Modifikation wegen neuer Physik.
[hackover2013-badge-firmware.git] / badge / util / fixed_point.h
index 05a8c79..8af7e82 100644 (file)
@@ -23,12 +23,15 @@ static inline bool fixed_point_eq(fixed_point x, fixed_point y) { return x.data
 static inline bool fixed_point_ne(fixed_point x, fixed_point y) { return x.data != y.data; }
 
 #define FIXED_POINT_I(x, y) { ((x) * 256) + ((y) * 256 / 1000) }
+#define FIXED_INT_I(x) FIXED_POINT_I(x, 0)
 
 static inline fixed_point FIXED_POINT(unsigned x, unsigned y) {
   fixed_point r = { ((int) x * 256) + ((int) y * 256 / 1000) };
   return r;
 }
 
+static inline fixed_point FIXED_INT(unsigned x) { return FIXED_POINT(x, 0); }
+
 static inline int fixed_point_cast_int(fixed_point x) { return x.data / 256; }
 
 static inline fixed_point fixed_point_min(fixed_point x, fixed_point y) { return fixed_point_lt(x, y) ? x : y; }
This page took 0.021421 seconds and 4 git commands to generate.