absolute double value - Java java.lang

Java examples for java.lang:double

Description

absolute double value

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        double val = 2.45678;
        System.out.println(abs(val));
    }//from  w ww .  ja  va2s  .c  om

    public static double abs(double val) {
        return Math.abs(val);
    }
}

Related Tutorials