}\r
\r
});\r
- model.functions.put("IEEEremainder", new Fn1(2) {\r
+ model.functions.put("mod", new Fn1(2) {\r
+\r
+ @Override\r
+ public Object evaluate(IEnvironment environment, int argc) {\r
+ Double x = (Double)environment.getValue(0);\r
+ Double y = (Double)environment.getValue(1);\r
+ return mod(x, y);\r
+ }\r
+\r
+ double mod(double x, double y) {\r
+ return x - Math.floor(x/y)*y;\r
+ }\r
+\r
+ });\r
+ model.functions.put("rem", new Fn1(2) {\r
\r
@Override\r
public Object evaluate(IEnvironment environment, int argc) {\r
Double y = (Double)environment.getValue(1);\r
return Math.IEEEremainder(x, y);\r
}\r
- \r
+\r
});\r
model.functions.put("ceil", new Fn1(1) {\r
\r
}\r
\r
private Set<Object> assigned = new HashSet<Object>();\r
- \r
+\r
}\r