This documentation is archived and is not being maintained.

Double.Epsilon Field

Represents the smallest positive Double greater than zero. This field is constant.

[Visual Basic]
Public Const Epsilon As Double
public const double Epsilon;
public: const double Epsilon;
public var Epsilon : double;


The value of this constant is 4.94065645841247e-324.

Two apparently equivalent floating point numbers might not compare equal because of differences in their least significant digits. For example, the C# expression, (double)1/3 == (double)0.33333, does not compare equal because the division operation on the left-hand side has maximum precision while the constant on the right-hand side is only precise to the visible digits.

Instead, determine if the two sides of a comparison are close enough to equal for your purposes by comparing whether the absolute value of the difference between the left and right-hand sides is less than Epsilon.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Double Structure | Double Members | System Namespace | Parse