Here you can find the source of unsignedSubOverflow(int operand1, int operand2)
public static boolean unsignedSubOverflow(int operand1, int operand2)
//package com.java2s; /*//from w w w .ja v a 2 s.c om * This file is part of MRP (http://mrp.codehaus.org/). * * This file is licensed to You under the Eclipse Public License (EPL); * You may not use this file except in compliance with the License. You * may obtain a copy of the License at * * http://www.opensource.org/licenses/eclipse-1.0.php * * See the COPYRIGHT.txt file distributed with this work for information * regarding copyright ownership. */ public class Main { /** * Returns true, if the subtraction of both operand1 - operand2 (both unsigned) will issue a borrow. */ public static boolean unsignedSubOverflow(int operand1, int operand2) { operand1 += Integer.MIN_VALUE; operand2 += Integer.MIN_VALUE; return operand1 < operand2; } }