Here you can find the source of signum(final double x)
private static int signum(final double x)
//package com.java2s; /*// www . j a v a 2 s. c o m * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient * * http://www.informatik.uni-kiel.de/rtsys/kieler/ * * Copyright 2008 by * + Christian-Albrechts-University of Kiel * + Department of Computer Science * + Real-Time and Embedded Systems Group * * This code is provided under the terms of the Eclipse Public License (EPL). * See the file epl-v10.html for the license text. */ public class Main { /** * Returns the signum function of the specified <tt>double</tt> value. The * return value is -1 if the specified value is negative; 0 if the specified * value is zero; and 1 if the specified value is positive. * * @return the signum function of the specified <tt>double</tt> value. */ private static int signum(final double x) { if (x < 0) { return -1; } if (x > 0) { return 1; } return 0; } }