Tag Archives: binary
Swap variables without temporaries (XOR swap)
Swapping variables has always been a bit of an annoyance while programming. It doesn’t matter whether you code in C, Java, MIPS, or any other language, you’ve really only had one way to swap variables.
All About Binary
This post contains information on how to convert decimal numbers to binary, 1′s complement, 2′s complement, and binary coded decimal. I’ve tried breaking it up to keep it somewhat organized, so hopefully you can follow.
Convert Decimal to 2′s Complement Binary in C
I was writing a program recently, and I needed a function that would convert a given decimal number to 2′s Complement (signed) binary. It’s simple enough to convert an unsigned integer to binary, but the sign (especially 2′s comp) makes … Continue reading