Package jmathexpr.arithmetic.natural

Examples of jmathexpr.arithmetic.natural.PrimeFactorization


        for (long p : powers.keySet()) {
            explist.add(new Exponentiation(
                    new LongNaturalNumber(p), new LongNaturalNumber(powers.get(p))));
        }
       
        return new PrimeFactorization(n, explist);
    }
View Full Code Here


       
        return new Division(l, r);
    }
   
    private Expression simplifyAdditive(BinaryOperation sum, NaturalNumber denominator) {
        PrimeFactorization factors = denominator.factorize();
        Expression l = sum.lhs();
        Expression r = sum.rhs();
        NaturalNumber divisor = Naturals.one();
       
        for (NaturalNumber p : factors.primeFactors()) {
            if (isDivisibleBy(l, p) && isDivisibleBy(r, p)) {
                l = new Division(l, p).evaluate();
                r = new Division(r, p).evaluate();
                divisor = (NaturalNumber) divisor.multiply(p);
            }
View Full Code Here

TOP

Related Classes of jmathexpr.arithmetic.natural.PrimeFactorization

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.