From: Myun2 Date: Sat, 11 Sep 2010 08:49:49 +0000 (+0900) Subject: roast_math.h: ROAST_BINARY() Add. X-Git-Tag: 20111130_shapeup_prev~216 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=323ad336b5e9eaf28a7d72aee44905f22d15c3a3;p=roast%2Froast.git roast_math.h: ROAST_BINARY() Add. --- diff --git a/roast/include/roast_math.h b/roast/include/roast_math.h index 365b1049..3ca2699d 100644 --- a/roast/include/roast_math.h +++ b/roast/include/roast_math.h @@ -28,6 +28,12 @@ #define ROAST_FTORAD(F) ROAST_FLOAT_TO_RAD(F) #define ROAST_F2RAD(F) ROAST_FLOAT_TO_RAD(F) +/* Example: 11001100 -> 204 */ +#define ROAST_BINARY(BIN) ( \ + (BIN & 1) | (BIN & 2) | (BIN & 4) |(BIN & 8) | \ + (BIN & 0x10) | (BIN & 0x20) | (BIN & 0x40) | (BIN & 0x80) | \ + (BIN & 0x100) | (BIN & 0x200) | (BIN & 0x400) | (BIN & 0x800) | \ + (BIN & 0x1000) | (BIN & 0x2000) | (BIN & 0x4000) | (BIN & 0x8000) ) /* ==== Functions ===================== */