Examples of LongNaturalNumber


Examples of jmathexpr.arithmetic.natural.impl.LongNaturalNumber

        if (exponent instanceof LongNaturalNumber) {
            LongIntegerNumber exp = (LongIntegerNumber) ((LongNaturalNumber) exponent).toInteger();

            if (exp.value == 0) {
                if (value != 0) {
                    return new LongNaturalNumber(1);
                } else {
                    throw new ArithmeticException(
                            String.format("Result is undefined: %s", new Exponentiation(this, exponent)));
                }
            } else if (exp.value == 1) {
View Full Code Here

Examples of jmathexpr.arithmetic.natural.impl.LongNaturalNumber

    }

    @Override
    public NaturalNumber toNatural() {
        if (value >= 0) {
            return new LongNaturalNumber(value);
        } else {
            throw new IllegalStateException("Cannot convert into a natural number: " + value);
        }
    }
View Full Code Here

Examples of jmathexpr.arithmetic.natural.impl.LongNaturalNumber

        return new LongIntegerNumber(numerator);
    }
   
    @Override
    public LongNaturalNumber denominator() {
        return new LongNaturalNumber(denominator);
    }
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.