1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include "[BitOps.h]"19 #include <string.h>20 21 22 [MATH_BEGIN_NAMESPACE]23 24 u32 [BinaryStringToValue](const char *str)25 {26 u32 val = 0;27 int strl = (int)strlen(str);28 for(int i = 0; i < strl && i < 32; ++i)29 if (str[strl-i-1] != '0')30 val |= 1 << i;31 return val;32 }33 34 [MATH_END_NAMESPACE] Go back to previous page