Java Abs Abs(Object in)

Here you can find the source of Abs(Object in)

Description

Abs

License

Open Source License

Declaration

public static final void Abs(Object in) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static final void Abs(Object in) {
        if (in == null)
            return;
        if (in instanceof double[]) {
            double[] inn = (double[]) in;
            for (int i = 0, s = inn.length; i < s; i++) {
                double x = inn[i];
                inn[i] = (x > 0 ? x : -x);
            }//from  w w  w  . j a v a  2 s. c  o m
        } else {
            for (int i = 0, s = ((Object[]) in).length; i < s; i++)
                Abs(((Object[]) in)[i]);
        }
    }
}

Related

  1. abs(int val)
  2. abs(int val)
  3. abs(int value)
  4. abs(int x)
  5. abs(long index)
  6. abs(short x)
  7. abs2(double[][] IN)
  8. abs2(float[] f)
  9. abs_fractional(double number)