Changeset 18100 for branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs
- Timestamp:
- 12/01/21 13:40:55 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs
r17811 r18100 54 54 55 55 var power = node.GetSubtree(1); 56 if(power is ConstantTreeNode constNode && Math.Truncate(constNode.Value) == constNode.Value) {56 if(power is NumberTreeNode constNode && Math.Truncate(constNode.Value) == constNode.Value) { 57 57 strBuilder.Append(" ").Append(token).Append(" ").Append(constNode.Value.ToString(formatString, numberFormat)); 58 58 } else { … … 141 141 142 142 if (!factorNode.Weight.IsAlmost(1.0)) strBuilder.Append(")"); 143 } else if (node.Symbol is Constant) {144 var constNode = node as ConstantTreeNode;143 } else if (node.Symbol is Number) { 144 var constNode = node as NumberTreeNode; 145 145 if (constants == null && constNode.Value < 0) { 146 146 strBuilder.Append("(").Append(constNode.Value.ToString(formatString, numberFormat)) … … 204 204 /// </summary> 205 205 /// <param name="symbolicExpressionTree">The tree representation of the expression.</param> 206 /// <param name="numberFormat"> Numberformat that should be used for numeric parameters (e.g. NumberFormatInfo.InvariantInfo (default)).</param>206 /// <param name="numberFormat">Constant format that should be used for numeric parameters (e.g. NumberFormatInfo.InvariantInfo (default)).</param> 207 207 /// <param name="formatString">The format string for numeric parameters (e.g. \"G4\" to limit to 4 digits, default is \"G\")</param> 208 208 /// <returns>Infix expression</returns>
Note: See TracChangeset
for help on using the changeset viewer.