Package jmathexpr.arithmetic.natural.impl

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


    }

    @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

        return new LongIntegerNumber(numerator);
    }
   
    @Override
    public LongNaturalNumber denominator() {
        return new LongNaturalNumber(denominator);
    }
View Full Code Here

TOP

Related Classes of jmathexpr.arithmetic.natural.impl.LongNaturalNumber

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.