int Compare(double a, double b)
{
if (a - b < 0d) return -1;
else if (a - b > 0d) return 1;
else return 0;
}