The following program shows the weird double to int conversion behavior I'm seeing in c++:

```
#include <stdlib.h>
#include <stdio.h>

int main() {
  double d = 33222.221;
  printf("d = %9.9g\n",d);

  d *= 1000;
  int i = (int)d;

  printf("d = %9.9g | i = %d\n",d,i);

  return 0;
}

```

When I compile and run the program, I see:

```
g++ test.cpp
./a.out
d = 33222.221
d =  33222221 | i = 33222220

```

Why is i not equal to 33222221?
The compiler version is GCC 4.3.0