Creates a new :class:`ConstantFloat`, adding it to the pool and
        returning it.

        :param value: The value of the new float.
766799
def create_float(self, value: float) -> Float:
        
        self.append((4, value))
        return self.get(self.raw_count - 1)
1170703
public static Float toFloat(Object o, Float defaultValue) {
	if (o instanceof Float) return (Float) o;
	if (defaultValue != null) return new Float(toFloatValue(o, defaultValue.floatValue()));

	float res = toFloatValue(o, Float.MIN_VALUE);
	if (res == Float.MIN_VALUE) return defaultValue;
	return new Float(res);
    }
1258042
def serialize(self, value):
        
        if isinstance(value, float) and self.as_type is six.text_type:
            value = u'{0:.{1}f}'.format(value, self.float_places)
            value = self.as_type(value)
        elif self.as_type is six.text_type:
            if isinstance(value, bool):
                # Store bools as 1/0 instead of True/False.
                value = six.text_type(int(bool(value)))
            elif isinstance(value, bytes):
                value = value.decode('utf-8', 'ignore')
            else:
                value = six.text_type(value)
        else:
            value = self.as_type(value)

        if self.suffix:
            value += self.suffix

        return value
657710
public static float getFloat(
    Object      value)
  {
    if (value == null)
    {
        return 0;
    }

    return Float.valueOf(value.toString()).floatValue();
  }
927272
public FloatConstant addFloat(float value)
  {
    FloatConstant entry = getFloatByValue(value);

    if (entry != null)
      return entry;

    entry = new FloatConstant(this, _entries.size(), value);

    addConstant(entry);

    return entry;
  }
1296218
public static Float toNullableFloat(Object value) {
		Double result = DoubleConverter.toNullableDouble(value);
		return result != null ? (float) ((double) result) : null;
	}
935435
public void add( float value ) {
		// see if it needs to grow the queue
		if( size >= data.length) {
			data[start] = value;
			start = (start+1)%data.length;
		} else {
			data[(start+size)%data.length] = value;
			size++;
		}
	}
12651
def add_lumMod(self, value):
        
        lumMod = self._add_lumMod()
        lumMod.val = value
        return lumMod
959638
def addl(self, value, start=0.0, end=float('inf')):
        
        self.add(Label(value, start=start, end=end))
71980
public void writeFloat(float value) throws UnsupportedEncodingException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeFloat", new Float(value));
    getBodyList().add(new Float(value));
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "writeFloat");
  }
1103859
def _cast_float(self, value):
        """"""
        try:
            return float(value)
        except ValueError:
            msg.err("Cannot convert {} to float for line {}.".format(value, self.identifier))
            exit(1)
78370
def value_convert(self, value, value_type):
        
        CONVERSION_OPTIONS = {
            "str": str,
            "int": int,
            "float": float,
            # Treat booleans specially
            "bool": (lambda val: val.lower() in ("true", "1")),
            # Auto-guess the type
            "auto": self.make_value,
        }

        try:
            return CONVERSION_OPTIONS[value_type](value)
        except (TypeError, ValueError):
            self.notify_user("Bad type conversion")
            return None
717926
def make_value(self, value):
        
        # ensure any escape sequences are converted to unicode
        value = self.unicode_escape_sequence_fix(value)

        if value and value[0] in ['"', "'"]:
            return self.remove_quotes(value)

        try:
            return int(value)
        except ValueError:
            pass
        try:
            return float(value)
        except ValueError:
            pass
        if value.lower() == "true":
            return True
        if value.lower() == "false":
            return False
        if value.lower() == "none":
            return None
        return value
1289114
static ConstantIntegerInfo make(ConstantPool cp, int value) {
        ConstantInfo ci = new ConstantIntegerInfo(value);
        return (ConstantIntegerInfo)cp.addConstant(ci);
    }
630968
def validate(self, instance, value):
        
        try:
            floatval = float(value)
            if not self.cast and abs(value - floatval) > TOL:
                self.error(
                    instance=instance,
                    value=value,
                    extra='Not within tolerance range of {}.'.format(TOL),
                )
        except (TypeError, ValueError):
            self.error(instance, value, extra='Cannot cast to float.')
        _in_bounds(self, instance, floatval)
        return floatval
399344
public static function ExpectRetrievedValueIsFloatish(
        string $property,
        $value,
        string $class_name
    ) : float {
        if (is_string($value) && is_numeric($value)) {
            $value = (float) $value;
        }

        /**
        * @psalm-var T
        */
        $value = static::MaybeThrowIfNotType($property, $value, $class_name, 'double');

        return $value;
    }
74337
static
	private Float toFloat(Object value){

		if(value instanceof Float){
			return (Float)value;
		} else

		if(value instanceof Double){
			Number number = (Number)value;

			return toFloat(number.floatValue());
		} else

		if((value instanceof Long) || (value instanceof Integer) || (value instanceof Short) || (value instanceof Byte)){
			Number number = (Number)value;

			return toFloat(number.floatValue());
		} else

		if(value instanceof Boolean){
			Boolean flag = (Boolean)value;

			return (flag.booleanValue() ? Numbers.FLOAT_ONE : Numbers.FLOAT_ZERO);
		} else

		if((value instanceof DaysSinceDate) || (value instanceof SecondsSinceDate) || (value instanceof SecondsSinceMidnight)){
			Number number = (Number)value;

			return toFloat(number.floatValue());
		}

		throw new TypeCheckException(DataType.FLOAT, value);
	}