Created
March 25, 2013 09:11
-
-
Save Mailaender/5235870 to your computer and use it in GitHub Desktop.
Try to calculate machine epsilon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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