Here you can find the source of abs(double d)
public static double abs(double d)
//package com.java2s; //License from project: Apache License public class Main { public static float abs(float f) { return f < 0 ? -f : f; }/*from w w w .java2 s . c o m*/ public static int abs(int i) { return i < 0 ? -i : i; } public static double abs(double d) { return d < 0 ? -d : d; } }