CSharp examples for System:Math Number
Test if Double is less than some other value by some degree of error in epsilon.
/// A port of the LoDMath static member class written in AS3 under the MIT license agreement. using System.Linq; using System.Collections.Generic; using System;//from w ww . j a v a2 s. c o m public class Main{ public static bool FuzzyGreaterThan(double a, double b) { return FuzzyGreaterThan(a, b, EPSILON); } /// <summary> /// Test if Double is less than some other value by some degree of error in epsilon. /// /// Due to float error, two values may be considered similar... but the computer considers them different. /// By using some epsilon (degree of error) once can test if the two values are similar. /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <param name="epsilon"></param> /// <returns></returns> /// <remarks></remarks> public static bool FuzzyGreaterThan(double a, double b, double epsilon) { return a > b - epsilon; } }