Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/28/17 09:03:34 (7 years ago)
Author:
pkimmesw
Message:

#2665 Testet Problems, Improved Performance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/FloatExpressions.cs

    r15334 r15341  
    449449      return interpreter.StringStack.IsEmpty ||
    450450             interpreter.StringStack.Top.Length == 0 ||
    451              !double.TryParse(interpreter.StringStack.Top, out tmp);
     451             !double.TryParse(
     452               interpreter.StringStack.Top,
     453               NumberStyles.AllowDecimalPoint | NumberStyles.Float,
     454               CultureInfo.InvariantCulture,
     455               out tmp);
    452456    }
    453457
    454458    public override void Eval(IInternalPushInterpreter interpreter) {
    455459      var str = interpreter.StringStack.Pop();
    456       var value = double.Parse(str, CultureInfo.InvariantCulture);
     460      var value = double.Parse(str, NumberStyles.AllowDecimalPoint | NumberStyles.Float, CultureInfo.InvariantCulture);
    457461
    458462      interpreter.FloatStack.Push(value);
Note: See TracChangeset for help on using the changeset viewer.