Here you can find the source of extractFloat(BigInteger bi, int start, int end, int decimal)
public static float extractFloat(BigInteger bi, int start, int end, int decimal)
//package com.java2s; import java.math.BigInteger; public class Main { public static float extractFloat(BigInteger bi, int start, int end, int decimal) { int intpart = extractInt(bi, start + decimal, end); int decpart = extractInt(bi, start, start + decimal); float decf = decpart; while (decf >= 1.0) { decf = decf / 10;/*from w w w.j a v a 2 s . com*/ } float ret = intpart + decf; return ret; } public static int extractInt(BigInteger bi, int start, int end) { bi = bi.shiftRight(start); int foo = (int) Math.pow(2, end - start) - 1; BigInteger mask = BigInteger.valueOf(foo); bi = bi.and(mask); return bi.intValue(); } }