Here you can find the source of Pow2(Object in, double val)
public static final void Pow2(Object in, double val)
//package com.java2s; //License from project: Open Source License public class Main { public static final void Pow2(Object in, double val) { if (in == null) return; if (in instanceof double[]) { double[] inn = (double[]) in; for (int i = 0, s = inn.length; i < s; i++) inn[i] = (Sign(inn[i]) * Math.pow(inn[i], val)); } else {/*from w ww. jav a2 s. c o m*/ for (int i = 0, s = ((Object[]) in).length; i < s; i++) Pow2(((Object[]) in)[i], val); } } public static final double Sign(double in) { return in < 0 ? -1.0 : 1.0; } public static final void Pow(double val, Object in) { if (in == null) return; if (in instanceof double[]) { double[] inn = (double[]) in; for (int i = 0, s = inn.length; i < s; i++) inn[i] = Math.pow(val, inn[i]); } else { for (int i = 0, s = ((Object[]) in).length; i < s; i++) Pow(((Object[]) in)[i], val); } } public static final void Pow(Object in, double val) { if (in == null) return; if (in instanceof double[]) { double[] inn = (double[]) in; for (int i = 0, s = inn.length; i < s; i++) inn[i] = Math.pow(inn[i], val); } else { for (int i = 0, s = ((Object[]) in).length; i < s; i++) Pow(((Object[]) in)[i], val); } } }