Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/08/17 08:46:31 (8 years ago)
Author:
pkimmesw
Message:

#2665 PushGP HL Integration, Fixed Math.Abs Overflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Problem/PushProblem.cs

    r14727 r14728  
    444444
    445445    private static double DoubleDiffer(double a, double b) {
    446       return Math.Abs(a - b);
     446      var result = a - b;
     447
     448      return result == double.MinValue ? double.MaxValue : Math.Abs(result);
    447449    }
    448450
    449451    private static double LongDiffer(long a, long b) {
    450       return Math.Abs(a - b);
     452      var result = a - b;
     453
     454      return result == long.MinValue ? long.MaxValue : Math.Abs(result);
    451455    }
    452456
Note: See TracChangeset for help on using the changeset viewer.