Possible Duplicate:
Double.Epsilon for equality, greater than, less than, less than or equal to, greater than or equal to
I recently discovered that FLT_EPSILON
as defined in <cfloat>
is not at all the same as Single.Epsilon
as defined in the .NET Framework.
FLT_EPSILON
is defined as the smallest such that 1.0 + epsilon != 1.0.Single.Epsilon
is defined as the smallest possible number greater than zero.
Is there a <cfloat>
-style epsilon defined somewhere in the .NET Framework? Or if I need to define my own, should that be defined identically in .NET as the value I see in <cfloat>
?