Here you can find the source of abs(int val)
public static final int abs(int val)
//package com.java2s; /**//from www .j a v a2 s .c o m * This class is part of JCodec ( www.jcodec.org ) This software is distributed * under FreeBSD License * * @author The JCodec project * */ public class Main { public static final int abs(int val) { int sign = (val >> 31); return (val ^ sign) - sign; } }