Here you can find the source of abs(short x)
Parameter | Description |
---|---|
x | a parameter |
public static short abs(short x)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . j av a2 s . c o m*/ * Returns the absolute value of a short value * @param x * @return */ public static short abs(short x) { x *= x < 0 ? -1 : 1; return x; } }