private static final int DOUBLE_MANTISSA_BITS = 53;
public static Number encode(BigInteger scalar) {
return innerEncode(new BigDecimal(scalar), 0);
}
public static Number encode(BigInteger scalar, int maxExponent) {
<BUG>if(maxExponent >= 0)

return innerEncode(new BigDecimal(scalar), getExponent(0, maxExponent));
throw new EncodeException("maxExponent must be a positive integer");</BUG>
}

private static final int DOUBLE_MANTISSA_BITS = 53;
public static Number encode(BigInteger scalar) {
return innerEncode(new BigDecimal(scalar), 0);
}
public static Number encode(BigInteger scalar, int maxExponent) {
if(maxExponent < 0)
throw new EncodeException("Input value cannot be encoded.");
return innerEncode(new BigDecimal(scalar), getExponent(0, maxExponent));
}
