Java Abs abs(int val)

Here you can find the source of abs(int val)

Description

abs

License

Apache License

Declaration

public static int abs(int val) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int abs(int val) {
        if (val >= 0)
            return val;
        return val * -1;
    }//from w  w  w.  j  a v a 2  s . c  o m

    public static long abs(long val) {
        if (val >= 0)
            return val;
        return val * -1;
    }
}

Related

  1. abs(int i)
  2. abs(int n)
  3. abs(int number)
  4. abs(int pos, double[] array)
  5. abs(int val)
  6. abs(int value)
  7. abs(int x)
  8. abs(long index)
  9. Abs(Object in)