Package jmathexpr.arithmetic.func

Examples of jmathexpr.arithmetic.func.Log


        assertEquals(evaluated, Naturals.one());
       
        x.setValue(R.create(1));
        System.out.printf("  %s%n", exp.evaluate());
       
        Function log = new Log(N.create(10), N.create(1000));
        evaluated = log.evaluate();
        System.out.printf("%s = %s%n", log, evaluated);
        assertEquals(evaluated, N.create(3));
    }
View Full Code Here


            LongNaturalNumber guess = log((LongNaturalNumber) base, (LongNaturalNumber) a);
           
            if (base.pow(guess).equals(a)) {
                return guess;
            } else {
                return new Log(base, a);
            }
        } else {
            throw new ArithmeticException(String.format("Undefined expression: log[%s](%s)", base, a));
        }
    }
View Full Code Here

TOP

Related Classes of jmathexpr.arithmetic.func.Log

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.