Java Number Round rounded_shift_down(long x, int n)

Here you can find the source of rounded_shift_down(long x, int n)

Description

roundeshifdown

License

Open Source License

Declaration

private static long rounded_shift_down(long x, int n) 

Method Source Code

//package com.java2s;
/*// w ww .j  av  a2 s . c om
** ShortenUtils.java
**
** Copyright (c) 2011 Peter McQuillan
**
** All Rights Reserved.
**                       
** Distributed under the BSD Software License (see license.txt)  
**
*/

public class Main {
    private static long rounded_shift_down(long x, int n) {
        if (n == 0)
            return (x);
        else {
            return ((x >> (n - 1)) >> 1);
        }
    }
}

Related

  1. roundBytesUpToWords(int bytes)
  2. roundChipRewardDown(long chips)
  3. roundCss(double v, int n)
  4. rounded(double value, int places, int ceilOrFloor)
  5. ROUNDED_DIV(long a, long b)
  6. roundedApply(double value, double percent, double delta)
  7. roundedDollarValue(double d)
  8. roundedLog(double value, double exponent)
  9. roundedLog10(int n)