Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/10/15 02:05:31 (10 years ago)
Author:
gkronber
Message:

#2283: eurocast experiments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Common/Extensions.cs

    r11846 r11974  
    77namespace HeuristicLab.Common {
    88  public static class Extensions {
    9    
     9
    1010    public static bool IsAlmost(this double x, double y) {
     11      if (double.IsNaN(x) || double.IsNaN(y)) return false;
     12      if (double.IsPositiveInfinity(x) && double.IsPositiveInfinity(y)) return true;
     13      if (double.IsNegativeInfinity(x) && double.IsNegativeInfinity(y)) return true;
    1114      return Math.Abs(x - y) < 1.0e-12;
    1215    }
Note: See TracChangeset for help on using the changeset viewer.