OSDN Git Service

roast_math.h: ROAST_BINARY() Add.
authorMyun2 <myun2@nwhite.info>
Sat, 11 Sep 2010 08:49:49 +0000 (17:49 +0900)
committerMyun2 <myun2@nwhite.info>
Sat, 11 Sep 2010 08:49:49 +0000 (17:49 +0900)
roast/include/roast_math.h

index 365b104..3ca2699 100644 (file)
 #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 ===================== */