Comparing ITimeStamp Objects

You can compare two ITimeStamp objects to determine whether they are equal, or whether one is later than the other. The following operators are defined: ==, !=, <, <=, >, and >=.

Note: Since all the operations are done using floating point arithmetic, be aware that some rounding error may occur.

The following example illustrates this point:

ITimeStamp TmStamp1(12345.54321);
ITimeStamp TmStamp2 = TmStamp1 + 9753.6802 - 9753.6802;
if (TmStamp1 == TmStamp2)
{
  printf("TmStamp1 == TmStamp2\n");
  printf("TmStamp1 = %30.20f\n", TmStamp1.asSeconds());
  printf("TmStamp2 = %30.20f\n', TmStamp2.asSeconds());
}
else
{
  printf("TmStamp1 != TmStamp2\n");
  printf("TmStamp1 = %30.20f\n", TmStamp1.asSeconds());
  printf("TmStamp2 = %30.20f\n", TmStamp2.asSeconds());
}

This examples displays the following output:

TmStamp1 != TmStamp2
TmStamp1 =     12345.54321000000000000000
TmStamp2 =     12345.54320999999800000000