int len = mag.length;
int d = mag[0];
// If this MutableBigInteger can't be fit into long, we need to
// make a BigInteger object for the resultant BigDecimal object.
if (len > 2 || (d < 0 && len == 2)) {
return $(new JSBigDecimal($(new JSBigInteger(mag, sign)), INFLATED, scale, 0));
}
long v = (len == 2) ? ((mag[1] & LONG_MASK) | (d & LONG_MASK) << 32) : d & LONG_MASK;
return BigDecimal.valueOf(sign == -1 ? -v : v, scale);
}