Skip to content

Instantly share code, notes, and snippets.

@Mailaender
Created March 25, 2013 09:11
Show Gist options
  • Select an option

  • Save Mailaender/5235870 to your computer and use it in GitHub Desktop.

Select an option

Save Mailaender/5235870 to your computer and use it in GitHub Desktop.
Try to calculate machine epsilon
using System;
namespace MachineEpsilon
{
class MainClass
{
public static void Main (string[] args)
{
double machEps = 1.0d;
do {
machEps /= 2.0d;
}
while ((double)(1.0 + machEps) != 1.0);
Console.WriteLine( "Calculated machine epsilon: " + machEps );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment