We distinguish between integers and floats with the _allowFloat flag.
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;
  }
}
1172188
def encode(cls, value):
        
        try:
            if float(value) + 0 == value:
                return repr(value)
        except (TypeError, ValueError):
            pass

        raise InvalidValue('not a float')
825411
private function isInteger($float, $allowIntegers)
    {
        if (!$allowIntegers || round($float) !== $float) {
            return false;
        } elseif (abs($float) < self::FLOAT_MAX) {
            return true;
        }

        return $allowIntegers === 'all';
    }
775263
private boolean isFloatingPoint(VisitorState state, Type type) {
    Type trueType = unboxedTypeOrType(state, type);
    return (trueType.getKind() == TypeKind.DOUBLE) || (trueType.getKind() == TypeKind.FLOAT);
  }
139304
def float2int(x):
    
    if not pd.isnull(x):
        if is_numeric(x):
            x=int(x)
    return x
174468
def get_float(self, input_string):
        

        if input_string == '--training_fraction':

            # was the flag set?
            try:
                index = self.args.index(input_string) + 1
            except ValueError:
                # it wasn't, it's optional, so return the appropriate default
                return None

            # the flag was set, so check if a value was set, otherwise exit
            try:
                if self.args[index] in self.flags:
                    print("\n {flag} was set but a value was not specified".format(flag=input_string))
                    print_short_help()
                    sys.exit(1)
            except IndexError:
                print("\n {flag} was set but a value was not specified".format(flag=input_string))
                print_short_help()
                sys.exit(1)

            # a value was set, so check if its the correct type
            try:
                value = float(self.args[index])
            except ValueError:
                print("\n {flag} must be a float less than or equal to 1, e.g. 0.4".format(flag=input_string))
                print_short_help()
                sys.exit(1)
            if value > 1.0 or value < 0:
                print("\n {flag} must be a float less than or equal to 1, e.g. 0.4".format(flag=input_string))
                print_short_help()
                sys.exit(1)

            # everything checks out, so return the appropriate value
            return value
534555
def set_float(val):
    
    out = None
    if not val in (None, ''):
        try:
            out = float(val)
        except ValueError:
            return None
        if numpy.isnan(out):
            out = default
    return out
654077
function isFloating(item) {
            return (
              /left|right/.test(item.css('float')) ||
              /inline|table-cell/.test(item.css('display'))
            );
          }
525597
def validate(self):
        
        super(FloatFilter, self).validate()

        try:
            self._value = float(self._value)
        except (ValueError, TypeError), exc:
            raise FilterError("Bad numerical value %r in %r (%s)" % (self._value, self._condition, exc))
236648
def getfloat(self, key, **kwargs):
        

        return self.get(key, cast_func=float, **kwargs)
1124227
def ask_float(msg="Enter a float", dft=None, vld=None, hlp=None):
    """"""
    vld = vld or [float]
    return ask(msg, dft=dft, vld=vld, fmt=partial(cast, typ=float), hlp=hlp)
602354
def positivefloat(value):
    
    f = float(not_empty(value))
    if f < 0:
        raise ValueError('float %s < 0' % f)
    return f
285173
def DEFINE_float(self, name, default, help, constant=False):
    """"""
    self.AddOption(
        type_info.Float(name=name, default=default, description=help),
        constant=constant)
182974
def _set_types(self):
        """"""
        # If we given something that is not an int or a float we raise
        # a RuntimeError as we do not want to have to guess if the given
        # input should be interpreted as an int or a float, for example the
        # interpretation of the string "1" vs the interpretation of the string
        # "1.0".
        for c in (self.x, self.y):
            if not ( isinstance(c, int) or isinstance(c, float) ):
                raise(RuntimeError('x, y coords should be int or float'))

        if isinstance(self.x, int) and isinstance(self.y, int):
            self._dtype = "int"
        else:
            # At least one value is a float so promote both to float.
            self.x = float(self.x)
            self.y = float(self.y)
            self._dtype = "float"
15381
def set_float(self, option, value):
        
        if not isinstance(value, float):
            raise TypeError("Value must be a float")
        self.options[option] = value
885567
def FloatBetweenZeroAndOne(x):
    """"""
    x = float(x)
    if 0 <= x <= 1:
        return x
    else:
        raise ValueError("{0} not a float between 0 and 1.".format(x))
1088760
def t_float(self, s):
        '
        self.rv.append(Token(type='FLOAT', attr=s))