Examples of ExprDouble


Examples of org.boris.expr.ExprDouble

public class RAND extends AbstractFunction
{
    public Expr evaluate(Expr[] args) throws ExprException {
        assertArgCount(args, 0);
        return new ExprDouble(Math.random());
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        if (value < counter.value)
            counter.value = value;
    }

    protected Expr evaluate(Counter counter) throws ExprException {
        return new ExprDouble(counter.value);
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        int count = 0;
        for (int i = 0; i < a.length; i++) {
            if (cond.eval(a[i]))
                count++;
        }
        return new ExprDouble(count);
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

    private Expr getRHS(String text, int offset, boolean str) {
        if (str) {
            return new ExprString(text.substring(offset));
        } else {
            try {
                return new ExprDouble(Double
                        .parseDouble(text.substring(offset)));
            } catch (NumberFormatException e) {
                return ExprMissing.MISSING;
            }
        }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        int count = 0;
        for (Expr m : matches) {
            if (m instanceof ExprNumber)
                count++;
        }
        return new ExprDouble(count);
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

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

Examples of org.boris.expr.ExprDouble

        Expr ec = evalArg(args[3]);
        if (!(ec instanceof ExprNumber))
            return ExprError.VALUE;
        boolean c = ((ExprNumber) ec).booleanValue();

        return new ExprDouble(Statistics.binomDist(nums, trials, p, c));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        if (base < 1)
            return ExprError.NUM;
        if (base == 1)
            return ExprError.DIV0;

        return new ExprDouble(Maths.log(num, base));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

            return ExprError.VALUE;
        int size = asInteger(esi, true);
        if (size < 1)
            return ExprError.NUM;

        return new ExprDouble(Statistics.confidence(alpha, stdev, size));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        double num = asDouble(args[0], true);
        int dig = 1;
        if (args.length == 2)
            dig = asInteger(args[1], true);
        if (dig == 1) {
            return new ExprDouble((int) num);
        } else {
            int div = (int) Math.pow(10, dig);
            int v = (int) (num * div);
            double d = (double) v / div;
            return new ExprDouble(d);
        }
    }
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.