Changeset 13807
- Timestamp:
- 04/27/16 22:03:01 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ChartUtil.cs
r13764 r13807 44 44 45 45 private static int Decimals(this double x) { 46 if ( double.IsInfinity(x) || double.IsNaN(x))46 if (x.IsAlmost(0) || double.IsInfinity(x) || double.IsNaN(x)) 47 47 return 0; 48 48 … … 71 71 return Math.Round(Math.Round(value * n) / n, precision); 72 72 } 73 74 private static bool IsAlmost(this double value, double other, double eps = 1e-12) { 75 return Math.Abs(value - other) < eps; 76 } 73 77 } 74 78 }
Note: See TracChangeset
for help on using the changeset viewer.