Java examples for java.lang:int
get mid point between two int
/******************************************************************************* * Copyright (C) 2013, 2015 Swirly Cloud Limited. All rights reserved. *******************************************************************************/ //package com.java2s; public class Main { public static void main(String[] argv) { int lo = 42; int hi = 42; System.out.println(midpoint(lo, hi)); }//from w w w . j a v a2 s . c o m public static int midpoint(int lo, int hi) { return lo + (hi - lo) / 2; } }