////////////////////////////////////////////////////////////////////////
// Numeric types
////////////////////////////////////////////////////////////////////////
191144
func isSignedInteger(v reflect.Value) bool {
	k := v.Kind()
	return k >= reflect.Int && k <= reflect.Int64
}
750921
function numberType(type, variable, explicit) {
		//  if the integer value is identical to the float value, it is an integer
		return (parseInt(variable, 10) === parseFloat(variable) ? 'int' : 'float') + (explicit ? '' : '|' + type);
	}
446982
public static double toNumber(Object val)
    {
        for (;;) {
            if (val instanceof Number)
                return ((Number) val).doubleValue();
            if (val == null)
                return +0.0;
            if (val == Undefined.instance)
                return NaN;
            if (val instanceof String)
                return toNumber((String) val);
            if (val instanceof CharSequence)
                return toNumber(val.toString());
            if (val instanceof Boolean)
                return ((Boolean) val).booleanValue() ? 1 : +0.0;
            if (val instanceof Symbol)
                throw typeError0("msg.not.a.number");
            if (val instanceof Scriptable) {
                val = ((Scriptable) val).getDefaultValue(NumberClass);
                if ((val instanceof Scriptable) && !isSymbol(val))
                    throw errorWithClassName("msg.primitive.expected", val);
                continue;
            }
            warnAboutNonJSObject(val);
            return NaN;
        }
    }
145554
function range(n,type) {
  n = (typeof n !== 'undefined') ?  n : 0;
  if (!(Number.isInteger(n))) throw Error("Error in range: Value must be an integer");
  let array;
    
  if(type=='Uint8')  array = new Uint8Array(n);
  if(type=='Uint16') array = new Uint16Array(n);
  if(type=='Uint32') array = new Uint32Array(n);
  if(type=='Int8')  array = new Int8Array(n);
  if(type=='Int16') array = new Int16Array(n);
  if(type=='Int32') array = new Int32Array(n);
  if(type=='Float32')  array = new Float32Array(n);
  if((typeof type === 'undefined') || !array)array = new Array(n);
    
  for(let i=0;i<n;i++)array[i]=i;
  return array;
}
954424
function strToNumber(value) {
    // Convert strings to numbers
    if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {
        return Number(value);
    }
    if (typeof value !== 'number') {
        throw new Error(value + " is not a number");
    }
    return value;
}
631629
function decodeDeltaArrayInt( bundle, database, len, num_type ) {
	var fromType = NUMTYPE_DELTA_INT.FROM[ num_type ],
		ans = new NUMTYPE_CLASS[ fromType ]( len ), v=0;

	// readTypedNum(fromType)
	switch (fromType) {
		case 0: v = bundle.u8[bundle.i8++]; break;
		case 1: v = bundle.s8[bundle.i8++]; break;
		case 2: v = bundle.u16[bundle.i16++]; break;
		case 3: v = bundle.s16[bundle.i16++]; break;
		case 4: v = bundle.u32[bundle.i32++]; break;
		case 5: v = bundle.s32[bundle.i32++]; break;
		case 6: v = bundle.f32[bundle.i32++]; break;
		case 7: v = bundle.f64[bundle.i64++]; break;
	}

	var values = bundle.readTypedArray( NUMTYPE_DELTA_INT.TO[ num_type ] , len - 1 );

	// Decode array
	ans[0] = v;
	for (var i=0, llen=values.length; i<llen; ++i) {
		v += values[i];
		ans[i+1] = v;
	}

	// Return
	return DEBUG
		? __debugMeta( ans, 'array.delta.int', {} )
		: ans;
}
165436
function _getTypeNumber(sText, nCorrectLevel) {			
		var nType = 1;
		var length = _getUTF8Length(sText);
		
		for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {
			var nLimit = 0;
			
			switch (nCorrectLevel) {
				case QRErrorCorrectLevel.L :
					nLimit = QRCodeLimitLength[i][0];
					break;
				case QRErrorCorrectLevel.M :
					nLimit = QRCodeLimitLength[i][1];
					break;
				case QRErrorCorrectLevel.Q :
					nLimit = QRCodeLimitLength[i][2];
					break;
				case QRErrorCorrectLevel.H :
					nLimit = QRCodeLimitLength[i][3];
					break;
			}
			
			if (length <= nLimit) {
				break;
			} else {
				nType++;
			}
		}
		
		if (nType > QRCodeLimitLength.length) {
			throw new Error("Too long data");
		}
		
		return nType;
	}
279323
@Override
    public void setDType(DataType dtype) {
        assert dtype == DataType.DOUBLE || dtype == DataType.FLOAT
                        || dtype == DataType.INT : "Invalid opType passed, must be float or double";
        // this.dtype = dtype;
    }
388781
function toNumberOrUndefined(n) {
    if (n === null || n === undefined) { return undefined; }
    if (validation.isObject(n) || validation.isArray(n)) { return undefined; }
    if (typeof n === 'boolean' || (typeof n === 'string' && n.length < 1)) { return undefined; }
    return isNaN(+n) ? undefined : +n;
}
1167782
function () {

    // trim number to 3 decimals
    function dec3 (v) {
      return Math.floor(v * 1000) / 1000;
    }

    var params = [];
    var usingPreset = this.data.preset != 'none' ? this.presets[this.data.preset] : false;

    if (usingPreset) {
      params.push('preset: ' + this.data.preset);
    }

    for (var i in this.schema) {
      if (i == 'preset' || (usingPreset && usingPreset[i] === undefined)) {
        continue;
      }
      var def = usingPreset ? usingPreset[i] : this.schema[i].default;
      var data = this.data[i];
      var type = this.schema[i].type;
      if (type == 'vec3') {
        var coords = def;
        if (typeof(def) == 'string') {
          def = def.split(' ');
          coords = {x: def[0], y: def[1], z: def[2]};
        }
        if (dec3(coords.x) != dec3(data.x) || dec3(coords.y) != dec3(data.y) || dec3(coords.z) != dec3(data.z)) {
          params.push(i + ': ' + dec3(data.x) + ' ' + dec3(data.y) + ' ' + dec3(data.z));
        }
      }
      else {
        if (def != data) {
          if (this.schema[i].type == 'number') {
            data = dec3(data);
          }
          params.push(i + ': ' + data);
        }
      }
    }
    console.log('%c' + params.join('; '), 'color: #f48;font-weight:bold');
  }
860338
function int (type) {
  type === 'int' ? 'int256' : type
  var storageBytes = parseInt(type.replace('int', '')) / 8
  return new IntType(storageBytes)
}
539717
public boolean mayBeNumeric()
  {
    if (type == UNKNOWN)
      type = NUMERIC;
    return type == NUMERIC || (type >= INT && type <= DOUBLE);
  }
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);
        }
    }
218189
public static boolean isNumber(Type t)
  {
    for(int i = 0; i < NUMERICAL_TYPES.length; i++) {
      if(NUMERICAL_TYPES[i] == t) {
        return true;
      }
    }
    return false;
  }
883094
function (mixed, base) {
            var type = typeof mixed;

            base = base || 10;

            if (type === "boolean") {
                return +mixed;

            } else if (type === "string") {
                mixed   = mixed.replace(/\s/g, "");
                var tmp = parseInt(mixed, base);
                return (isNaN(tmp) || !isFinite(tmp)) ? 0 : tmp;

            } else if (type === "number" && isFinite(mixed)) {
                /* jshint -W016 */
                return mixed | 0;
                /* jshint +W016 */

            } else {
                return 0;
            }
        }
975564
function NumberType(typeSpec) {
  // Default to integer values
  this._allowFloat = !!typeSpec.allowFloat;

  if (typeSpec) {
    this._min = typeSpec.min;
    this._max = typeSpec.max;
    this._step = typeSpec.step || 1;

    if (!this._allowFloat &&
        (this._isFloat(this._min) ||
         this._isFloat(this._max) ||
         this._isFloat(this._step))) {
      throw new Error('allowFloat is false, but non-integer values given in type spec');
    }
  }
  else {
    this._step = 1;
  }
}
56701
protected void registerNumberDatatypes() {

    registerStandardDatatype(Integer.class);
    registerStandardDatatype(Long.class);
    registerStandardDatatype(Double.class);
    registerStandardDatatype(Float.class);
    registerStandardDatatype(Byte.class);
    registerStandardDatatype(Short.class);
    registerStandardDatatype(BigInteger.class);
    registerStandardDatatype(BigDecimal.class);
    registerStandardDatatype(Number.class);
  }