Here you can find the source of signum(final int i)
Parameter | Description |
---|---|
i | the function argument |
public static int signum(final int i)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w .j a v a2s. co m * signum function. * @param i the function argument * @return -1, 0 or 1 if the argument is negative, 0 or positive */ public static int signum(final int i) { if (i < 0) { return -1; } else if (i > 0) { return 1; } else { return 0; } } }