Register number and numeric dual basic types
@param {string} numberType
@param {string} numericType
@param {Function} checkFn
@param {function(string, *):Object} toJSONSchema
@private
760095
function registerDual(numberType, numericType, checkFn, toJSONSchema) {
		context.registerType(numberType, 'number', checkFn, numberType, extra => toJSONSchema('number', extra))

		context.registerType(numericType, 'string', value => {
			let numberValue = toNumber(value)
			checkFn(numberValue)
			return numberValue
		}, numericType, () => ({
				type: 'string',
				format: numericType
			}))
	}
566927
function financialNumber (value) {
  const num = Number(value)
  if (value !== num || num < -99999999.99 || num > 99999999.99) {
    throw new Error(`Value '${value}' is not a valid number.`)
  }
}
761611
void expectNumberOrSymbol(Node n, JSType type, String msg) {
    if (!type.matchesNumberContext() && !type.matchesSymbolContext()) {
      mismatch(n, msg, type, NUMBER_SYMBOL);
    }
  }
1054289
function ScriptNum(num, base) {
  if (!(this instanceof ScriptNum))
    return new ScriptNum(num, base);

  I64.call(this, num, base);
}
224899
function scanNumericLiteral() {
        var number, start, ch;

        ch = source[index];
        assert(isDecimalDigit(ch) || (ch === '.'),
            'Numeric literal must start with a decimal digit or a decimal point');

        start = index;
        number = '';
        if (ch !== '.') {
            number = source[index++];
            ch = source[index];

            // Hex number starts with '0x'.
            // Octal number starts with '0'.
            if (number === '0') {
                if (ch === 'x' || ch === 'X') {
                    number += source[index++];
                    while (index < length) {
                        ch = source[index];
                        if (!isHexDigit(ch)) {
                            break;
                        }
                        number += source[index++];
                    }

                    if (number.length <= 2) {
                        // only 0x
                        throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                    }

                    if (index < length) {
                        ch = source[index];
                        if (isIdentifierStart(ch)) {
                            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                        }
                    }
                    return {
                        type: Token.NumericLiteral,
                        value: parseInt(number, 16),
                        lineNumber: lineNumber,
                        lineStart: lineStart,
                        range: [start, index]
                    };
                } else if (isOctalDigit(ch)) {
                    number += source[index++];
                    while (index < length) {
                        ch = source[index];
                        if (!isOctalDigit(ch)) {
                            break;
                        }
                        number += source[index++];
                    }

                    if (index < length) {
                        ch = source[index];
                        if (isIdentifierStart(ch) || isDecimalDigit(ch)) {
                            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                        }
                    }
                    return {
                        type: Token.NumericLiteral,
                        value: parseInt(number, 8),
                        octal: true,
                        lineNumber: lineNumber,
                        lineStart: lineStart,
                        range: [start, index]
                    };
                }

                // decimal number starts with '0' such as '09' is illegal.
                if (isDecimalDigit(ch)) {
                    throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                }
            }

            while (index < length) {
                ch = source[index];
                if (!isDecimalDigit(ch)) {
                    break;
                }
                number += source[index++];
            }
        }

        if (ch === '.') {
            number += source[index++];
            while (index < length) {
                ch = source[index];
                if (!isDecimalDigit(ch)) {
                    break;
                }
                number += source[index++];
            }
        }

        if (ch === 'e' || ch === 'E') {
            number += source[index++];

            ch = source[index];
            if (ch === '+' || ch === '-') {
                number += source[index++];
            }

            ch = source[index];
            if (isDecimalDigit(ch)) {
                number += source[index++];
                while (index < length) {
                    ch = source[index];
                    if (!isDecimalDigit(ch)) {
                        break;
                    }
                    number += source[index++];
                }
            } else {
                ch = 'character ' + ch;
                if (index >= length) {
                    ch = '<end>';
                }
                throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
            }
        }

        if (index < length) {
            ch = source[index];
            if (isIdentifierStart(ch)) {
                throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
            }
        }

        return {
            type: Token.NumericLiteral,
            value: parseFloat(number),
            lineNumber: lineNumber,
            lineStart: lineStart,
            range: [start, index]
        };
    }
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;
            }
        }
1278049
function checkType(type, value, errors) {
	if (type) {
		var actualType = typeof value;

		if (typeof type == 'string') {
			type = type.toLowerCase();
			switch(type) {
				case 'any':
					return [];
				case 'array':
					if (!Array.isArray(value)) {
						return [{
							property: path,
							message: 'expected an array, but ' + actualType + ' found instead'
						}];
					}
					break;
				case 'integer':
				case 'int':
					type = 'integer';
					break;
				case 'float':
				case 'double':
				case 'number':
					type = 'number';
					// fall through
				default:
					if (actualType != type) {
						return [{
							property: path,
							message: 'expected ' + type + ', but ' + actualType + ' found instead'
						}];
					}
					break;
			}
			return [];
		}

		if (Array.isArray(type)) {
			var unionErrors = [];
			for(var j = 0; j < type.length; j++) { // a union type
				var errs = checkType(type[j], value, errors);
				if (!errs.length) { return []; }
				unionErrors = unionErrors.concat(errs);
			}
			return unionErrors;
		} else if (typeof type == 'object') {
			return checkProp(value, type, path);
		}
	}

	return [];
}
69075
function encodeNumber_(num) {
  let encodedNumber = '';
  while (num >= 0x20) {
    encodedNumber += CHAR64_.charAt(
      0x20 | (num & 0x1f));
    num >>= 5;
  }
  encodedNumber += CHAR64_.charAt(num);
  return encodedNumber;
}
761262
function JsonSchema (schema) {
  if (!schema) {
    throw ono({ status: 500 }, "Missing JSON schema");
  }
  if (schema.type !== undefined && dataTypes.indexOf(schema.type) === -1) {
    throw ono({ status: 500 }, "Invalid JSON schema type: %s", schema.type);
  }

  this.schema = schema;
}
935851
def valid? number
      raise_on_type_mismatch number
      num, check = split_number(number)
      self.of(num) == check
    end
1345177
function Checksum(type, val) {
    this.type = type;
    this.val = val || 0;
    switch (this.type) {
        case 0x00:
            this._compute = this._computeNone;
            break;
        case 0x01:
            this._compute = this._computeCrc32;
            break;
        case 0x02:
            this._compute = this._computeFarm32;
            break;
        case 0x03:
            this._compute = this._computeCrc32C;
            break;
        default:
            assert(false, 'invalid checksum type ' + this.type);
    }
}
380797
function isValidNumber(value: any): boolean {
  return typeof value === 'number' && value === value && value !== Infinity && value !== -Infinity
}
272182
function _convertToNumber(str) {
        if (typeof str !== "string") {
            return { isNumber: false, value: null };
        }

        var val = parseFloat(+str, 10),
            isNum = (typeof val === "number") && !isNaN(val) &&
                    (val !== Infinity) && (val !== -Infinity);

        return {
            isNumber: isNum,
            value:    val
        };
    }
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);
  }
1177491
public static PactDslJsonRootValue numberType(Number number) {
    PactDslJsonRootValue value = new PactDslJsonRootValue();
    value.setValue(number);
    value.setMatcher(TypeMatcher.INSTANCE);
    return value;
  }
858497
public static boolean isNumber(JsonNode node, boolean isTypeLoose) {
        if (node.isNumber()) {
            return true;
        } else if (isTypeLoose) {
            if (TypeFactory.getValueNodeType(node) == JsonType.STRING) {
                return isNumeric(node.textValue());
            }
        }
        return false;
    }
709391
function TypedNumber (config) {
    const number = this;

    // validate min
    if (config.hasOwnProperty('min') && !util.isNumber(config.min)) {
        const message = util.propertyErrorMessage('min', config.min, 'Must be a number.');
        throw Error(message);
    }

    // validate max
    if (config.hasOwnProperty('max') && !util.isNumber(config.max)) {
        const message = util.propertyErrorMessage('max', config.max, 'Must be a number.');
        throw Error(message);
    }

    // validate max is greater than min
    if (config.hasOwnProperty('max') && config.hasOwnProperty('min') && config.min > config.max) {
        const message = util.propertyErrorMessage('max', config.max, 'Must be a number that is less than the minimum: ' + config.min + '.');
        throw Error(message);
    }

    // define properties
    Object.defineProperties(number, {

        exclusiveMax: {
            /**
             * @property
             * @name TypedNumber#exclusiveMax
             * @type {boolean}
             */
            value: !!config.exclusiveMax,
            writable: false
        },

        exclusiveMin: {
            /**
             * @property
             * @name TypedNumber#exclusiveMin
             * @type {boolean}
             */
            value: !!config.exclusiveMin,
            writable: false
        },

        integer: {
            /**
             * @property
             * @name TypedNumber#integer
             * @type {boolean}
             */
            value: !!config.integer,
            writable: false
        },

        max: {
            /**
             * @property
             * @name TypedNumber#max
             * @type {number}
             */
            value: Number(config.max),
            writable: false
        },

        min: {
            /**
             * @property
             * @name TypedNumber#min
             * @type {number}
             */
            value: Number(config.min),
            writable: false
        }

    });

    return number;
}