Java Abs abs(double x)

Here you can find the source of abs(double x)

Description

abs

License

Open Source License

Declaration

public static double abs(double x) 

Method Source Code

//package com.java2s;

public class Main {

    public static double abs(double x) {
        if (x >= 0)
            return x;
        else//from w w  w  . j ava 2s  .c o m
            return -x;
    }

    public static int abs(int x) {
        if (x >= 0)
            return x;
        else
            return -x;
    }
}

Related

  1. abs(double self)
  2. abs(double value)
  3. abs(double value)
  4. abs(double value)
  5. abs(double x)
  6. abs(double x)
  7. abs(double z)
  8. abs(double... values)
  9. abs(double[] arr)