My 50s in Hex Equals My Dad’s 80s

19 June 2010

Truman is my dad. My birthday is at the end of May and Truman’s birthday is near the end of June. I turned 50 during May of 2007 and Truman turned 80 during June of 2007.

Now for number system tidbit… 50 in base-16 (hexadecimal, or hex) is 80 in base-10 (decimal) because five units of 16 plus zero ones equals eight units of 10 plus zero ones. In many programming languages, numbers prefixed with 0x (or 0X) are numbers being represented in hex. For example, 0x50 is 80, 0x51 is 81, 0x52 is 82, 0x53 is 83, …, 0x59 is 89.

Now to the point of this posting…During my 6th and Truman’s 9th decades of life, for 11 of every 12 months, my age in hex equals Truman’s decimal age. When Truman and I turn 90 and 60, respectively, my hex age will no longer equals Truman’s age (i.e. 0x60 is 96, not 90).

Note: This posting was published when I was 53 and Truman was 82 (i.e. my age in hex was one more than Truman’s age in decimal).

5-Digit Year Problem

31 December 2009

I am a member of the Long Now Foundation and the Long Now Foundation uses 5-digit years (e.g. 2010 is 02010). 2010, unlike 2009, is a valid octal (base-8) number.

Many of the C-family programming languages have a 5-digit year problem.

Numbers that start with a zero are treated as octal numbers by the compiler. 02009 is not a valid octal number because nine is not a valid octal digit. 02010 is comprised of four valid octal digits.

/* int lastyear = 02009; // doesn't compile */
int thisyear = 02010; // compiles
cout << thisyear; // prints 1032