Java Thread Callable powerTo(final double base, final double[] exponents)

Here you can find the source of powerTo(final double base, final double[] exponents)

Description

power To

License

Open Source License

Declaration

public static Callable powerTo(final double base, final double[] exponents) throws Exception 

Method Source Code


//package com.java2s;
import java.util.concurrent.*;

public class Main {
    public static Callable powerTo(final double base, final double[] exponents) throws Exception {
        Callable c = new Callable() {
            public Object call() throws Exception {
                double[] result = new double[exponents.length];
                for (int i = 0; i < exponents.length; i++) {
                    result[i] = Math.pow(base, exponents[i]);
                }/*  w ww.  j a va2 s.co m*/
                return result;
            }
        };
        return c;
    }
}

Related

  1. getRandomValueForPrimitive(Class type)
  2. invokeAll(Collection> tasks, ExecutorService executorService)
  3. invokeBulkActions(Collection> tasks)
  4. max(final double[] a, final double[] b)
  5. minScalar(final double[] a, final double scalar)
  6. repeatedlyTry(Callable task, int maxRounds, long backoff)
  7. resolveCompositeKey(final String key, final Map props)
  8. resolveSingle(Object object)
  9. runAndRethrowRuntimeExceptionOnFailure(final Callable operation, final String exceptionMessage)