C# Single Epsilon

Description

Single Epsilon represents the smallest positive Single value that is greater than zero. This field is constant.

Syntax

Single.Epsilon has the following syntax.


public const float Epsilon

Example

For example, the following code shows how to use Epsilon.


/*w  w  w  .  ja  v a2s.  co  m*/
using System;

public class Example
{
   public static void Main()
   {
      float[] values = { 0f, Single.Epsilon, Single.Epsilon * .5f };

      for (int ctr = 0; ctr <= values.Length; ctr++)
      {
         Console.WriteLine(values[ctr]);
      }      
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version