Here you can find the source of meanLow(final int a, final int b)
public static int meanLow(final int a, final int b)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . ja v a2 s.co m*/ * @return Mean without overflow, rounded to the lowest value (i.e. mathematical floor((a+b)/2), using floating * point division). */ public static int meanLow(final int a, final int b) { return (a & b) + ((a ^ b) >> 1); } /** * @return Mean without overflow, rounded to the lowest value (i.e. mathematical floor((a+b)/2), using floating * point division). */ public static long meanLow(final long a, final long b) { return (a & b) + ((a ^ b) >> 1); } }