Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/11 16:45:46 (13 years ago)
Author:
mkommend
Message:

#1418: Merged trunk changes into branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Common/3.3/DoubleExtensions.cs

    r5445 r5796  
    2424  public static class DoubleExtensions {
    2525    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      }
    2732    }
    2833  }
Note: See TracChangeset for help on using the changeset viewer.