Tests whether a field is to be externalized as a BigDecimal
774030
public static boolean isBigDecimal(Schema schema) {
        if (Type.BYTES == schema.getType()) {
            JsonNode logicalTypeNode = schema.getJsonProp("logicalType");
            if (logicalTypeNode != null
                    && "decimal".equals(logicalTypeNode.asText())) {
                return true;
            }
        }
        return false;
    }
198932
public static UnsignedLong valueOf(BigInteger value) {
    checkNotNull(value);
    checkArgument(value.signum() >= 0 && value.bitLength() <= Long.SIZE,
        "value (%s) is outside the range for an unsigned long value", value);
    return fromLongBits(value.longValue());
  }
4928
def / other
      if other.is_a?(BigDecimal) && other < 1
        precision = 10 * precs.first
        (self * precision) / (other * precision)
      else
        super
      end
    end
992810
public static boolean isScalarNullableType(Field field) {
        FieldType type = field.getType();
        return STRING.equals(type) || BYTES.equals(type) || type instanceof io.protostuff.compiler.model.Enum;
    }
757532
protected BigDecimal asBigDecimal(String name, Map<String, Value> params) {
        return coerceToBigDecimal(params.get(name));
    }
1249811
def is_outside_bounds(self, val):
    """"""
    return ((self.lower_bound is not None and val < self.lower_bound) or
            (self.upper_bound is not None and val > self.upper_bound))
396729
function checkDifficulty(value) {
    var v = bignumber_1.bigNumberify(value);
    try {
        return v.toNumber();
    }
    catch (error) { }
    return null;
}
318180
def unsigned_big_integer(self, column, auto_increment=False):
        
        return self.big_integer(column, auto_increment, True)
871020
private static boolean hasMagic(byte[] edata) {
        try {
            int i = 0;
            while (i < edata.length) {
                if (get16(edata, i) == JAR_MAGIC) {
                    return true;
                }
                i += get16(edata, i + 2) + 4;
            }
        } catch (ArrayIndexOutOfBoundsException e) {
            // Invalid extra field data
        }
        return false;
    }
1220072
public static BigDecimal validateBigDecimalValue(BigDecimal newValue, int expectedPrecision,int expectedScale)
    {
        if(newValue != null)
        {
            int scale = newValue.scale();
            int precision = newValue.precision();

            if(isAbsBetweenZeroAndOne(newValue))
            {
                newValue = newValue.setScale(expectedScale, java.math.RoundingMode.HALF_UP);
            }
            else
            {
                int integerPart = precision - scale;
                int expectedIntegerPart = expectedPrecision - expectedScale;

                if (integerPart > expectedIntegerPart)
                {
                    throw new MithraBusinessException("Invalid BigDecimal: " + newValue.toPlainString() + ". Expected a BigDecimal with (precision, scale) of: (" + expectedPrecision + "," + expectedScale + ")");
                }
                if (scale != expectedScale || precision > expectedPrecision)
                {
                    scale = expectedScale;
                    newValue = newValue.setScale(scale, java.math.RoundingMode.HALF_UP);
                }
            }
        }
        return newValue;
    }
486866
public static BigDecimal sum(EvaluationContext ctx, Object... args) {
        if (args.length == 0) {
            throw new RuntimeException("Wrong number of arguments");
        }

        BigDecimal result = BigDecimal.ZERO;
        for (Object arg : args) {
            result = result.add(Conversions.toDecimal(arg, ctx));
        }
        return result;
    }
1190901
@Override
    public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
        checkColumnBounds(columnIndex);
        try {
            final VoltType type = table.getColumnType(columnIndex - 1);
            BigDecimal decimalValue = null;
            switch(type) {
            case TINYINT:
                decimalValue = new BigDecimal(table.getLong(columnIndex - 1));
                break;
            case SMALLINT:
                decimalValue = new BigDecimal(table.getLong(columnIndex - 1));
                break;
            case INTEGER:
                decimalValue = new BigDecimal(table.getLong(columnIndex - 1));
                break;
            case BIGINT:
                decimalValue = new BigDecimal(table.getLong(columnIndex - 1));
                break;
            case FLOAT:
                decimalValue = new BigDecimal(table.getDouble(columnIndex - 1));
                break;
            case DECIMAL:
                decimalValue = table.getDecimalAsBigDecimal(columnIndex - 1);
                break;
            default:
                throw new IllegalArgumentException("Cannot get BigDecimal value for column type '" + type + "'");
            }

            return table.wasNull() ? null : decimalValue;
        } catch (Exception x) {
            throw SQLError.get(x);
        }
    }
867860
static boolean isFieldRequired(Field field) {
    BigQueryDataField bqAnnotation = field.getAnnotation(BigQueryDataField.class);

    return (bqAnnotation != null && bqAnnotation.mode().equals(BigQueryFieldMode.REQUIRED))
        || field.getType().isPrimitive();
  }
841440
def isnamedtuple(obj):
    """"""
    return isinstance(obj, tuple) \
           and hasattr(obj, "_fields") \
           and hasattr(obj, "_asdict") \
           and callable(obj._asdict)
874669
function assertLong(value, unsigned) {
    if (typeof value === 'number') {
        return Long.fromNumber(value, unsigned);
    } else if (typeof value === 'string') {
        return Long.fromString(value, unsigned);
    } else if (value && value instanceof Long) {
        if (typeof unsigned !== 'undefined') {
            if (unsigned && !value.unsigned) return value.toUnsigned();
            if (!unsigned && value.unsigned) return value.toSigned();
        }
        return value;
    } else
        throw TypeError("Illegal value: "+value+" (not an integer or Long)");
}
981945
private boolean isBigintColumn(String columnName, List<String> tableNames, boolean debugPrint) {
        List<String> bigintColumnTypes = Arrays.asList("BIGINT");
        return isColumnType(bigintColumnTypes, columnName, tableNames, debugPrint);
    }
8704
function(value){
    if(_.isUndefined(value) || !_.isObject(value))
        return false;

    return (value instanceof BigNumber) ? true : false;
}