From 7fda20976399f88625a741570de24fde32937024 Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Mon, 19 Dec 2011 12:01:50 +0000 Subject: [PATCH] Undo revision 4243 - alternative fix coming up git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@4248 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/parser/ast/ExpressionFunc.java | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/prism/src/parser/ast/ExpressionFunc.java b/prism/src/parser/ast/ExpressionFunc.java index 4161727c..5ac01bbc 100644 --- a/prism/src/parser/ast/ExpressionFunc.java +++ b/prism/src/parser/ast/ExpressionFunc.java @@ -232,10 +232,6 @@ public class ExpressionFunc extends Expression public Object evaluateFloor(EvaluateContext ec) throws PrismLangException { - //Check number of operands - if (getNumOperands() != 1) - throw new PrismLangException("The function floor() requires exactly 1 parameter", this); - double d = Math.floor(getOperand(0).evaluateDouble(ec)); // Check for NaN or +/-inf, otherwise possible errors lost in cast to int if (Double.isNaN(d) || Double.isInfinite(d)) @@ -245,10 +241,6 @@ public class ExpressionFunc extends Expression public Object evaluateCeil(EvaluateContext ec) throws PrismLangException { - //Check number of operands - if (getNumOperands() != 1) - throw new PrismLangException("The function ceil() requires exactly 1 parameter", this); - double d = Math.ceil(getOperand(0).evaluateDouble(ec)); // Check for NaN or +/-inf, otherwise possible errors lost in cast to int if (Double.isNaN(d) || Double.isInfinite(d)) @@ -258,10 +250,6 @@ public class ExpressionFunc extends Expression public Object evaluatePow(EvaluateContext ec) throws PrismLangException { - //Check number of operands - if (getNumOperands() != 2) - throw new PrismLangException("The function pow() requires exactly 2 parameters", this); - double base = getOperand(0).evaluateDouble(ec); double exp = getOperand(1).evaluateDouble(ec); // Not allowed to do e.g. pow(2,-2) because of typing (should be pow(2.0,-2) instead) @@ -280,10 +268,6 @@ public class ExpressionFunc extends Expression public Object evaluateMod(EvaluateContext ec) throws PrismLangException { - //Check number of operands - if (getNumOperands() != 2) - throw new PrismLangException("The function mod() requires exactly 2 parameters", this); - int i = getOperand(0).evaluateInt(ec); int j = getOperand(1).evaluateInt(ec); // Non-positive divisor not allowed @@ -296,10 +280,6 @@ public class ExpressionFunc extends Expression public Object evaluateLog(EvaluateContext ec) throws PrismLangException { - //Check number of operands - if (getNumOperands() != 2) - throw new PrismLangException("The function log() requires exactly 2 parameters", this); - double x, b; x = getOperand(0).evaluateDouble(ec); b = getOperand(1).evaluateDouble(ec);