Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dectobin(x) -- only works with integers
- local r = ""
- for i = 0, 7 do
- r = (x % 2^i) .. r
- x = x - (x % 2^i) -- dunno if this is necessary, but i think it is
- end
- return tonumber(r)
- end
Advertisement
Add Comment
Please, Sign In to add comment