Package org.boris.expr

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.round(num, dps));
    }
View Full Code Here


public class TODAY extends AbstractFunction
{
    public Expr evaluate(Expr[] args) throws ExprException {
        assertArgCount(args, 0);
        return new ExprDouble(ExcelDate.toExcelDate(new Date().getTime()));
    }
View Full Code Here

                return ExprError.VALUE;
            b = ((ExprNumber) eB).doubleValue();
        }
        if (x < a || x > b || a == b)
            return ExprError.NUM;
        return new ExprDouble(Statistics.betaDist(x, alpha, beta, a, b));
    }
View Full Code Here

    }

    protected Expr evaluate(Counter counter) throws ExprException {
        if (counter.result != null)
            return counter.result;
        return new ExprDouble(1. / (counter.value / counter.count));
    }
View Full Code Here

        double life = asDouble(args[2], true);
        double per = asDouble(args[3], true);
        double syd = ((cost - salvage) * (life - per + 1) * 2) /
                (life * (life + 1));

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

            return ExprError.VALUE;
        double alpha = ((ExprNumber) ea).doubleValue();
        if (alpha < 0 || alpha > 1)
            return ExprError.NUM;

        return new ExprDouble(Statistics.critBinom(trials, p, alpha));
    }
View Full Code Here

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

        if (!isNumber(eDF))
            return ExprError.VALUE;
        int df = ((ExprNumber) eDF).intValue();
        if (df < 0 || df > 10e10)
            return ExprError.NUM;
        return new ExprDouble(Statistics.chiInv(p, df));
    }
View Full Code Here

            return ExprError.NUM;
        double m = val % rnd;
        m = Maths.round(m, 8);
        if (m == rnd)
            m = 0;
        return new ExprDouble(val - m);
    }
View Full Code Here

            return ExprError.VALUE;
        double d = ((ExprNumber) eD).doubleValue();
        double r = ExcelDate.date(y, m, d);
        if (r < 0)
            return ExprError.NUM;
        return new ExprDouble(r);
    }
View Full Code Here

TOP

Related Classes of org.boris.expr.ExprDouble

Copyright © 2018 www.massapicom. 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.