Java Number Max Value max(int idx, int orderFrom, int orderTo)

Here you can find the source of max(int idx, int orderFrom, int orderTo)

Description

Returns the greatest index in order orderTo of healpix pixels contained by the healpix pixel of index idx in order orderFrom.

License

Open Source License

Parameter

Parameter Description
idx a parameter
orderFrom a parameter
orderTo a parameter

Return

the greatest index in order orderTo of healpix pixels contained by the healpix pixel of index idx in order orderFrom.

Declaration

public static final int max(int idx, int orderFrom, int orderTo) 

Method Source Code

//package com.java2s;
// of the GNU General Public License version 3.

public class Main {
    /**//  w  ww. ja  va2 s . co  m
     * Returns the greatest index in order <i>orderTo</i> of healpix pixels contained by
     * the healpix pixel of index <i>idx</i> in order <i>orderFrom</i>.
     * @param idx
     * @param orderFrom
     * @param orderTo
     * @return the greatest index in order <i>orderTo</i> of healpix pixels contained by
     * the healpix pixel of index <i>idx</i> in order <i>orderFrom</i>.
     */
    public static final int max(int idx, int orderFrom, int orderTo) {
        if (orderFrom > orderTo)
            throw new IllegalArgumentException("'orderFrom' must be smaller than 'orderTo'!");
        return ((++idx) << ((orderTo - orderFrom) << 1)) - 1;
    }
}

Related

  1. max(int a, int b, int c, int d)
  2. max(int a, int b, int c, int d)
  3. max(int i, int j)
  4. max(int i, int j)
  5. max(int i, int j, int k)
  6. max(int x, int x2, int x3)
  7. max(int x, int y)
  8. max(Integer a, Integer b)
  9. max(Integer i1, Integer i2)