mellowcandle / bitwise

Terminal based bit manipulator in ncurses
GNU General Public License v3.0
640 stars 28 forks source link

Add support for leading 0 on binary numbers #46

Closed hugolundin closed 3 years ago

hugolundin commented 3 years ago

Languages such as python and C support writing binary numbers with a leading zero: 0b1000. Bitwise does not currently support this, but I think it is something that should be. For one, I thought bitwise had a bug when it interpreted 0b1000 as simply 0.

This merge request implements support for this. Thanks to 0x already being supported, it was a minor change and I don't expected it to break anything. Additionally, I added two new tests; one for making sure that the result is same when using b and b, and another one for making sure that there would not be any issues putting 0b in the beginning of the calculation.

Thank you for a great little utility :)

mellowcandle commented 3 years ago

🙂