Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/13/21 17:49:34 (2 years ago)
Author:
gkronber
Message:

#3140: made several more changes for the constant -> number branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionPythonFormatter.cs

    r18100 r18115  
    229229    private static void FormatNumericTreeNode(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
    230230      var symbol = node.Symbol;
    231       double value = 0.0;
    232       if (symbol is INumericSymbol) {
    233         var numNode = node as INumericTreeNode;
    234         value = numNode.Value;
     231      if (node is INumericTreeNode numNode) {
     232        strBuilder.Append(numNode.Value.ToString("g17", CultureInfo.InvariantCulture));
    235233      } else {
    236234        throw new NotSupportedException("Formatting of symbol: " + symbol + " not supported for Python symbolic expression tree formatter.");
    237235      }
    238        
    239 
    240       strBuilder.Append(value.ToString("g17", CultureInfo.InvariantCulture));
    241236    }
    242237
Note: See TracChangeset for help on using the changeset viewer.