First, an old trick I used to use many years ago: multiply the values by 10 until the significant digits are all on the left of the decimal point, cast to integer values and compare those. So:

```
var precision = 11;
double d2 = d*(precision*10);
double f2 = f*(precision*10);
int dWhole = (int)d2;
int fWhole = (int)f2;
return (dWhole==fWHole);
```

Secondly, and probably what I would do nowadays, is to provide a method that compares double values within a certain precision, such as this:

```
public class MathUtilities
{
public static readonly double DOUBLE_PRECISION = 5*Double.Epsilon;
public static bool Equal(double d1, double d2) { return Math.Abs(d1 - d2) <= DOUBLE_PRECISION; }
}
```

At this point, to compare up to 11 decimal digits, you need to use an appropriately small 'precision' value (instead of the 5*Double.Epsilon I used above), like 0.000[...]009HTH

round(10^n*d) != round(10^n*f) <br> or what do you want to do?

<br> Regards Martin