- Timestamp:
- 03/22/11 16:45:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Common/3.3/DoubleExtensions.cs
r5445 r5796 24 24 public static class DoubleExtensions { 25 25 public static bool IsAlmost(this double x, double y) { 26 return Math.Abs(x - y) < 1.0E-12; 26 if (double.IsInfinity(x)) { 27 if (x > 0) return double.IsPositiveInfinity(y); 28 else return double.IsNegativeInfinity(y); 29 } else { 30 return Math.Abs(x - y) < 1.0E-12; 31 } 27 32 } 28 33 }
Note: See TracChangeset
for help on using the changeset viewer.