Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- There's actually a much more traditional way of converting a number to a decimal number, that is more efficient than my own method.
- -- So, time to try and make it (oh god it's so much cleaner)
- -- Old Method: https://pastebin.com/Bq6yMnsz
- number = 101 -- this will be the number to be converted
- local bin = ""
- while number >= 1 do
- if number % 2 == 1 then
- number = number - 1
- number = number/2
- bin = "1"..bin
- else
- number = number / 2
- bin = "0"..bin
- end
- end
- print(bin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement