public static bool IsZero(this double value) { // We actually consider anything within an order of magnitude of // epsilon to be zero return Math.Abs(value) < 2.2204460492503131E-15; }