package com.sheep.gamegroup.util;

/**
 * Created by realicing on 2018/4/18.
 * realicing@sina.com
 */
public class BinaryUtil {
    public static boolean isInt(int num, int index, int thsInt) {
        return get(num, index) == thsInt;
    }

    /**
     * @param num:要获取二进制值的数
     * @param index:倒数第一位为0，依次类推
     */
    public static int get(int num, int index) {
        return (num & (0x1 << index)) >> index;
    }

}
