Changeset 17301 for trunk/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 10/03/19 12:14:19 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs
r17180 r17301 226 226 227 227 public static Interval CubicRoot(Interval a) { 228 if (a.LowerBound < 0) return new Interval(double.NaN, double.NaN); 229 return new Interval(Math.Pow(a.LowerBound, 1.0/3), Math.Pow(a.UpperBound, 1.0/3)); 228 var lower = (a.LowerBound < 0) ? -Math.Pow(-a.LowerBound, 1d / 3d) : Math.Pow(a.LowerBound, 1d / 3d); 229 var upper = (a.UpperBound < 0) ? -Math.Pow(-a.UpperBound, 1d / 3d) : Math.Pow(a.UpperBound, 1d / 3d); 230 231 return new Interval(lower, upper); 230 232 } 231 233 #endregion
Note: See TracChangeset
for help on using the changeset viewer.