Skip to main content

Timeline for answer to How do I convert an integer to binary in JavaScript? by ganesh phirke

Current License: CC BY-SA 4.0

Post Revisions

8 events
when toggle format what by license comment
Mar 10, 2023 at 0:02 history wiki removed Makyen
Mar 9, 2023 at 23:59 history made wiki Post Made Community Wiki by Makyen
Aug 27, 2020 at 15:55 comment added barlop putting the positive numbers starting with 1 e.g. 7 as 111, are a problem. 'cos if you want positive numbers to start from 1, then how do you know what 111 is, whether it's 7 or -1. Your program puts -1 as 11111111111111111111111111111111 and 7 as 111. In 2s complement, 1111111 and 111 are the same number. -1.
Aug 27, 2020 at 7:22 comment added ganesh phirke converted the negative numbers to unsigned representation. Now the logic will work for positive or negative numbers. Thanks @barlop
Aug 27, 2020 at 7:14 history edited ganesh phirke CC BY-SA 4.0
deleted 11 characters in body
Aug 27, 2020 at 6:25 history edited ganesh phirke CC BY-SA 4.0
added 100 characters in body
Aug 26, 2020 at 13:53 comment added barlop questioned wanted negative too
Aug 26, 2020 at 8:27 history answered ganesh phirke CC BY-SA 4.0