I am occasionally asked why I study computer science. The following C bug is what planted the germ for me:

#include <stdio.h>

int main() {

  if ((0.1 + 0.1 + 0.1) == 0.3) {
    printf("Computers are cool!.\n");
  } else {
    printf("Computers are weird.\n");
  }

  return 0;
}

I didn't figure that one out until I discovered that numbers in a computer are not what they seem.

In case you're wondering, I was writing a program to calculate grain yield for homebrewing. Someday I'll put that program up here.

This page is already printer-friendly.

Valid XHTML 1.1! Get Firefox
©2003 danwuzheer design
This page is valid XHTML 1.1.
If you want all of your traffic to fall into a deep, dark hole, please email me at devnull@barowy.net.