Examples of ExprDouble


Examples of org.boris.expr.ExprDouble

        if (values[1] == 0) {
            return ExprError.DIV0;
        }

        return new ExprDouble(values[0] / values[1]);
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

{
    public Expr evaluate(Expr[] args) throws ExprException {
        assertArgCount(args, 2);
        double num = asDouble(args[0], true);
        int dps = asInteger(args[1], true);
        return new ExprDouble(Maths.roundUp(num, dps));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

{
    public Expr evaluate(Expr[] args) throws ExprException {
        double res = 0;
        for (Expr arg : args)
            res += sumsq(arg);
        return new ExprDouble(res);
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        assertArgCount(args, 1);

        ExprArray arr = new ExprArray(4, 4);
        for (int i = 0; i < arr.rows(); i++) {
            for (int j = 0; j < arr.columns(); j++) {
                arr.set(i, j, new ExprDouble((i + 1) * (j + 1)));
            }
        }
        return arr;
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        String s = asString(e, false);
        Double d = ValueParser.parse(s);

        if (d != null)
            return new ExprDouble(d.doubleValue());
        else
            return ExprError.VALUE;
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        }

        double vdb = Financials.vdb(cost, salvage, life, start_period,
                end_period, factor, no_switch);

        return new ExprDouble(vdb);
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        if (a instanceof ExprArray) {
            ExprArray ar = (ExprArray) a;
            a = ar.get(0);
        }
        if (a instanceof ExprNumber) {
            return new ExprDouble(((ExprNumber) a).doubleValue());
        }
        return ExprDouble.ZERO;
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

            return ExprError.VALUE;
        int cho = ((ExprNumber) eCho).intValue();
        if (num < 0 || cho < 0 || num < cho)
            return ExprError.NUM;

        return new ExprDouble(Statistics.permut(num, cho));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

                double r = ((ExprDouble) res).doubleValue();
                if (r < d)
                    d = r;
            }
        }
        return new ExprDouble(d);
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        if (arg instanceof ExprEvaluatable) {
            arg = ((ExprEvaluatable) arg).evaluate();
        }

        if (arg instanceof ExprNumber) {
            return new ExprDouble(((ExprNumber) arg).doubleValue());
        }

        if (arg instanceof ExprArray) {
            return min(((ExprArray) arg).getArgs());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.