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


                }
            }
            sum += p;
        }

        return new ExprDouble(sum);
    }
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.chiDist(x, df));
    }
View Full Code Here

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

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

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

        if (arg instanceof ExprArray) {
            return max(((ExprArray) arg).getArgs());
        }
View Full Code Here

        String s = ((ExprString) a).str;
        if ("directory".equalsIgnoreCase(s)) {
            return new ExprString(System.getProperty("user.dir"));
        } else if ("memavail".equalsIgnoreCase(s)) {
            return new ExprDouble(Runtime.getRuntime().freeMemory());
        } else if ("memused".equalsIgnoreCase(s)) {
            return new ExprDouble(Runtime.getRuntime().totalMemory() -
                    Runtime.getRuntime().freeMemory());
        } else if ("numfile".equalsIgnoreCase(s)) {
            return ExprError.REF; // TODO
        } else if ("origin".equalsIgnoreCase(s)) {
            return ExprError.REF; // TODO
        } else if ("osversion".equalsIgnoreCase(s)) {
            return ExprError.REF; // TODO
        } else if ("recalc".equalsIgnoreCase(s)) {
            return ExprError.REF; // TODO
        } else if ("release".equalsIgnoreCase(s)) {
            return ExprError.REF; // TODO
        } else if ("system".equalsIgnoreCase(s)) {
            return ExprError.REF; // TODO
        } else if ("totmem".equalsIgnoreCase(s)) {
            return new ExprDouble(Runtime.getRuntime().totalMemory());
        }

        return ExprError.VALUE;
    }
View Full Code Here

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

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

        values[0] = values[1] = 0;

        for (Expr a : args)
            eval(a, average, values, true);

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

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

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

        }

        if (count == 0)
            return ExprError.DIV0;

        return new ExprDouble(p / count);
    }
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.