Checks it the given value is a feasible decimal longitude

    :param val: value to be checked
    :type val: int of float
    :returns:  `None`
    :raises: *ValueError* if value is out of longitude boundaries, *AssertionError* if type is wrong
195299
def assert_is_lon(val):
    
    assert type(val) is float or type(val) is int, "Value must be a number"
    if val < -180.0 or val > 180.0:
        raise ValueError("Longitude value must be between -180 and 180")
409114
function checkPrecision(val, base) {
  val = Math.round(Math.abs(val));
  return isNaN(val)? base : val;
}
274108
def p_val(p):
    

    def val(s):
        try:
            x = float(s)
        except:
            x = 0
            warning(p.lineno(1), "Invalid string numeric constant '%s' evaluated as 0" % s)
        return x

    if p[2].type_ != TYPE.string:
        api.errmsg.syntax_error_expected_string(p.lineno(1), TYPE.to_string(p[2].type_))
        p[0] = None
    else:
        p[0] = make_builtin(p.lineno(1), 'VAL', p[2], lambda x: val(x), type_=TYPE.float_)
596209
def cql_encode_float(self, val):
        
        if math.isinf(val):
            return 'Infinity' if val > 0 else '-Infinity'
        elif math.isnan(val):
            return 'NaN'
        else:
            return repr(val)
639766
function toFloat(val, def) {
    if (is_1.isFloat(val))
        return val;
    if (!is_1.isValue(val))
        return toDefault(null, def);
    var parsed = function_1.tryWrap(parseFloat, val)(def);
    if (is_1.isFloat(parsed) || is_1.isNumber(parsed))
        return parsed;
    if (toBoolean(val))
        return 1;
    return 0;
}
15381
def set_float(self, option, value):
        
        if not isinstance(value, float):
            raise TypeError("Value must be a float")
        self.options[option] = value
11926
def isfinite(val):
    
    if not np.isscalar(val):
        val = asarray(val, strict=False)

    if val is None:
        return False
    elif isinstance(val, np.ndarray):
        if val.dtype.kind == 'M':
            return ~isnat(val)
        elif val.dtype.kind == 'O':
            return np.array([isfinite(v) for v in val], dtype=bool)
        elif val.dtype.kind in 'US':
            return np.ones_like(val, dtype=bool)
        return np.isfinite(val)
    elif isinstance(val, datetime_types+timedelta_types):
        return not isnat(val)
    elif isinstance(val, basestring):
        return True
    return np.isfinite(val)
541799
def convert_float(value, parameter):
    '''
    
    '''
    value = _check_default(value, parameter, ( '', '-', None ))
    if value is None or isinstance(value, float):
        return value
    try:
        return float(value)
    except Exception as e:
        raise ValueError(str(e))
84948
public void putFloat(Float val) throws IOException {
    putInt(java.lang.Float.floatToIntBits(val.getValue()));
  }
581329
def _convert_value(val):
    
    def _is_number(x, op):
        try:
            op(x)
            return True
        except ValueError:
            return False
    if isinstance(val, (list, tuple)):
        return [_convert_value(x) for x in val]
    elif val is None:
        return val
    elif _is_number(val, int):
        return int(val)
    elif _is_number(val, float):
        return float(val)
    elif val.find(";;") >= 0:
        return [_convert_value(v) for v in val.split(";;")]
    elif val.startswith(("{", "[")):
        # Can get ugly JSON output from CWL with unicode and ' instead of "
        # This tries to fix it so parsed correctly by json loader
        return json.loads(val.replace("u'", "'").replace("'", '"'))
    elif val.lower() == "true":
        return True
    elif val.lower() == "false":
        return False
    else:
        return val
114112
def validate(self, value):
        
        try:
            # trap blank fields here
            if not self.blank or value:
                float(value)
            return value
        except ValueError:
            return None
1313899
def __CheckValid(self, value):
        ""
        val = self.__val
        self.is_valid = True
        try:
            val = set_float(value)
            if self.__min is not None and (val < self.__min):
                self.is_valid = False
                val = self.__min
            if self.__max is not None and (val > self.__max):
                self.is_valid = False
                val = self.__max
        except:
            self.is_valid = False
        self.__bound_val = self.__val = val
        fgcol, bgcol = self.fgcol_valid, self.bgcol_valid
        if not self.is_valid:
            fgcol, bgcol = self.fgcol_invalid, self.bgcol_invalid

        self.SetForegroundColour(fgcol)
        self.SetBackgroundColour(bgcol)
        self.Refresh()
393709
def ok(self):
        
        try:
            v = float(self._value)
            if v < self.fmin or v > self.fmax:
                return False
            else:
                return True
        except:
            return False
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
147301
function float(val, bit) {
    var ret = parseFloat(val);
    return isNaN(ret) ? 0 : bit != null ? ret.toFixed(bit) : ret;
  }
440026
def _prepare_value(val, maxlen=50, notype=False):
    
    if val is None or val is True or val is False:
        return str(val)
    sval = repr(val)
    sval = sval.replace("\n", " ").replace("\t", " ").replace("`", "'")
    if len(sval) > maxlen:
        sval = sval[:maxlen - 4] + "..." + sval[-1]
    if notype:
        return sval
    else:
        tval = checker_for_type(type(val)).name()
        return "%s of type %s" % (sval, tval)
528816
def is_value_type_valid_for_exact_conditions(self, value):
    
    # No need to check for bool since bool is a subclass of int
    if isinstance(value, string_types) or isinstance(value, (numbers.Integral, float)):
      return True

    return False