#include "windows.h" extern "C" { #include "math.h" #include "string.h" #include "stdio.h" #include "stdlib.h" #include "lua/lua.h" #include "lua/lauxlib.h" #include "lua/lualib.h" } #define PROJECT_TABLENAME "luamodule" #ifdef WIN32 #define LUA_API __declspec(dllexport) #else #define LUA_API #endif const char* DecToBin(lua_State *Lua, double num) { if(num == 0) return "0"; char *bt = new char[1024]; bt[0] = '\0'; num = (long long) num; while(1) { lua_pushnumber(Lua, (int)num % 2); strcat(bt,lua_tostring(Lua, lua_gettop(Lua))); if(((double)num / 2) == 0.5) { for(int i=0,j=strlen(bt)-1;i