The Clock Angle Problem

Reading an analog clock is a skill that some kids need to master these days. Oh, I’m sure that eventually everyone figures it out. When I was a kid, digital clocks were rare. No, we all learned how to tell time by looking at a round disk with 12 numbers and a big hand and a little hand. If a second hand was available, well it was just more entertainment for the terminally bored child.
Continue reading →

Keeping Up with the Booleans

As a programmer well-versed in Assembly Language, I’m all too familiar with the bits that populate a byte. At the low, low level you find plenty of tools to do bit manipulation. The C language has bitwise operators as well, which remains one of its advantages over the newer, trendier programming languages. So, how does all this fun activity cross over into the realm of the _Bool or bool data type in C?
Continue reading →

Booleans

One of the weaknesses of the C language when measured against the newer, trendier programming languages is that it lacks a Boolean type. That is, a variable that’s either one or zero. This issue was addressed with the C99 standard and its addition of the underscore _Bool data type. It’s furthered in the C23 standard with the (better) bool type as well as the true and false keywords available in just about every other programming language used today. It’s time for a deep dive into the binary pool of bool.
Continue reading →