diff --git a/src/main/java/de/tla2bAst/BAstCreator.java b/src/main/java/de/tla2bAst/BAstCreator.java index cf868dca8d0f0b996a1bef9bf28f40862ad2e67e..796454bf6f004e5906d45d94fc18288e1d029e90 100644 --- a/src/main/java/de/tla2bAst/BAstCreator.java +++ b/src/main/java/de/tla2bAst/BAstCreator.java @@ -523,11 +523,15 @@ public class BAstCreator extends BuiltInOPs implements TranslationGlobals, BBuil case OpApplKind: return visitOpApplNodeExpression((OpApplNode) exprNode); case NumeralKind: { - String number = String.valueOf(((NumeralNode) exprNode).val()); + NumeralNode node = (NumeralNode) exprNode; + String number = String.valueOf(node.useVal() ? node.val() : node.bigVal()); return createPositionedNode(new AIntegerExpression(new TIntegerLiteral(number)), exprNode); } case DecimalKind: { - return createPositionedNode(new ARealExpression(new TRealLiteral(exprNode.toString())), exprNode); + DecimalNode node = (DecimalNode) exprNode; + String number = String.valueOf(node.bigVal() == null ? node.mantissa() * Math.pow(10,node.exponent()) : node.bigVal()); + // the image of BigDecimal should always be with .0, because the node would not have been of DecimalKind otherwise + return createPositionedNode(new ARealExpression(new TRealLiteral(number)), exprNode); } case StringKind: { StringNode s = (StringNode) exprNode;