-package org.simantics.spreadsheet.graph.formula;\r
-\r
-import org.simantics.spreadsheet.graph.CellFormulaFunction;\r
-import org.simantics.spreadsheet.graph.CellValueVisitor;\r
-import org.simantics.spreadsheet.graph.SpreadsheetGraphUtils;\r
-import org.simantics.spreadsheet.graph.parser.ast.AstArgList;\r
-\r
-public class SqrtFormulaFunction implements CellFormulaFunction<Object> {\r
-\r
- @Override\r
- public Object evaluate(CellValueVisitor visitor, AstArgList args) {\r
- if (args.values.size() != 1) throw new IllegalStateException();\r
- \r
- Object number = args.values.get(0).accept(visitor);\r
- Double dVal = SpreadsheetGraphUtils.asDoubleWhereEmptyStringIsZero(number);\r
- if(dVal==null) return FormulaError2.handleErrorCall(number);\r
- if(dVal<0) return FormulaError2.NUM.getString();\r
-\r
- return Math.sqrt(dVal);\r
- }\r
-}\r
+package org.simantics.spreadsheet.graph.formula;
+
+import org.simantics.spreadsheet.graph.CellFormulaFunction;
+import org.simantics.spreadsheet.graph.CellValueVisitor;
+import org.simantics.spreadsheet.graph.SpreadsheetGraphUtils;
+import org.simantics.spreadsheet.graph.parser.ast.AstArgList;
+
+public class SqrtFormulaFunction implements CellFormulaFunction<Object> {
+
+ @Override
+ public Object evaluate(CellValueVisitor visitor, AstArgList args) {
+ if (args.values.size() != 1) throw new IllegalStateException();
+
+ Object number = args.values.get(0).accept(visitor);
+ Double dVal = SpreadsheetGraphUtils.asDoubleWhereEmptyStringIsZero(number);
+ if(dVal==null) return FormulaError2.handleErrorCall(number);
+ if(dVal<0) return FormulaError2.NUM.getString();
+
+ return Math.sqrt(dVal);
+ }
+}