Package org.jscience.mathematics.number

Examples of org.jscience.mathematics.number.Float64


    double doubleValue = eq.currentValue.doubleValue();
    int intValue = eq.currentValue.intValue();
    if (v(doubleValue).minus(v(intValue)).doubleValue() == 0.0) {
      return eq(currentValue.pow(eq.intValue()));
    }
    Float64 base = Float64.valueOf(currentValue.doubleValue());
    Float64 exponent = Float64.valueOf(eq.doubleValue());
    Float64 pow = base.pow(exponent);
    return eq(pow.doubleValue());
  }
View Full Code Here


        System.out.print("Float64 add: ");
        startTime();
        for (int i = 0; i < 10000; i++) {
            StackContext.enter();
            Float64 x = Float64.ONE;
            for (int j = 0; j < results.length; j++) {
                results[j] = x.plus(x);
            }
            StackContext.exit();
        }
        endTime(10000 * results.length);

        System.out.print("Float64 multiply: ");
        startTime();
        for (int i = 0; i < 10000; i++) {
            StackContext.enter();
            Float64 x = Float64.valueOf(1.0);
            for (int j = 0; j < results.length; j++) {
                results[j] = x.times(x);
            }
            StackContext.exit();
        }
        endTime(10000 * results.length);

        System.out.print("Complex add: ");
        startTime();
        for (int i = 0; i < 10000; i++) {
            StackContext.enter();
            Complex x = Complex.valueOf(1.0, 2.0);
            for (int j = 0; j < results.length; j++) {
                results[j] = x.plus(x);
            }
            StackContext.exit();
        }
        endTime(10000 * results.length);

        System.out.print("Complex multiply: ");
        startTime();
        for (int i = 0; i < 10000; i++) {
            StackContext.enter();
            Complex x = Complex.valueOf(1.0, 2.0);
            for (int j = 0; j < results.length; j++) {
                results[j] = x.times(x);
            }
            StackContext.exit();
        }
        endTime(10000 * results.length);

        System.out.print("Amount<Mass> add: ");
        startTime();
        for (int i = 0; i < 10000; i++) {
            StackContext.enter();
            Amount<Mass> x = Amount.valueOf(1.0, SI.KILOGRAM);
            for (int j = 0; j < results.length; j++) {
                results[j] = x.plus(x);
            }
            StackContext.exit();
        }
        endTime(10000 * results.length);

        System.out.print("Amount<Mass> multiply: ");
        startTime();
        for (int i = 0; i < 10000; i++) {
            StackContext.enter();
            Amount<Mass> x = Amount.valueOf(1.0, SI.KILOGRAM);
            for (int j = 0; j < results.length; j++) {
                results[j] = x.times(x);
            }
            StackContext.exit();
        }
        endTime(10000 * results.length);

 
View Full Code Here

TOP

Related Classes of org.jscience.mathematics.number.Float64

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.