// SectionSetFloat stores the section/key/value triple to this INI,
// creating it if it wasn't already present.
422818
func (ini *INI) SectionSetFloat(section, key string, value float64) {
    ini.SectionSet(section, key, strconv.FormatFloat(value, 'f', 8, 64))
}
602796
func (z *Big) SetFloat64(x float64) *Big {
	if x == 0 {
		var sign form
		if math.Signbit(x) {
			sign = signbit
		}
		return z.setZero(sign, 0)
	}
	if math.IsNaN(x) {
		var sign form
		if math.Signbit(x) {
			sign = signbit
		}
		return z.setNaN(0, qnan|sign, 0)
	}
	if math.IsInf(x, 0) {
		if math.IsInf(x, 1) {
			z.form = pinf
		} else {
			z.form = ninf
		}
		return z
	}

	// The gist of the following is lifted from math/big/rat.go, but adapted for
	// base-10 decimals.

	const expMask = 1<<11 - 1
	bits := math.Float64bits(x)
	mantissa := bits & (1<<52 - 1)
	exp := int((bits >> 52) & expMask)
	if exp == 0 { // denormal
		exp -= 1022
	} else { // normal
		mantissa |= 1 << 52
		exp -= 1023
	}

	if mantissa == 0 {
		return z.SetUint64(0)
	}

	shift := 52 - exp
	for mantissa&1 == 0 && shift > 0 {
		mantissa >>= 1
		shift--
	}

	z.exp = 0
	z.form = finite | form(bits>>63)

	if shift > 0 {
		z.unscaled.SetUint64(uint64(shift))
		z.unscaled.Exp(c.FiveInt, &z.unscaled, nil)
		arith.Mul(&z.unscaled, &z.unscaled, mantissa)
		z.exp = -shift
	} else {
		// TODO(eric): figure out why this doesn't work for _some_ numbers. See
		// https://github.com/ericlagergren/decimal/issues/89
		//
		// z.compact = mantissa << uint(-shift)
		// z.precision = arith.Length(z.compact)

		z.compact = c.Inflated
		z.unscaled.SetUint64(mantissa)
		z.unscaled.Lsh(&z.unscaled, uint(-shift))
	}
	return z.norm()
}
1030998
func GetFloat(key string) (float64, error) {
	value, err := Get(key)
	if err != nil {
		return 0, err
	}
	switch v := value.(type) {
	case float64:
		return v, nil
	case float32:
		return float64(v), nil
	case int:
		return float64(v), nil
	case string:
		if floatVal, err := strconv.ParseFloat(v, 64); err == nil {
			return floatVal, nil
		}
	}
	return 0, &InvalidValue{key, "float"}
}
1242657
func (context *BaseContext) SetFloat(key string, value float64) {
	context.userData[key] = value
}
822769
func (v *Container) ChildSet(w IWidget, propName string, value interface{}) {

	ptr := C.CString(propName)
	defer cfree(ptr)

	switch value.(type) {
	case bool:
		C._gtk_container_child_set_bool(CONTAINER(v), ToNative(w), gstring(ptr), gbool(value.(bool)))
	case int:
		C._gtk_container_child_set_int(CONTAINER(v), ToNative(w), gstring(ptr), gint(value.(int)))
	}
}
1303554
func (d Data) GetFloat(key string) float64 {
	if !d.KeyExists(key) || len(d.Values[key]) == 0 {
		return 0.0
	}
	str := d.Get(key)
	if result, err := strconv.ParseFloat(str, 64); err != nil {
		panic(err)
	} else {
		return result
	}
}
1247847
func (c *IniConfigContainer) Float(key string) (float64, error) {
	return strconv.ParseFloat(c.getdata(key), 64)
}
950001
func appendFloat(dst []byte, f float64, fmt byte, prec int, bitSize int) []byte {
	return genericFtoa(dst, f, fmt, prec, bitSize)
}
1247976
func (ini *INI) Keys(section string) []string {
	s := ini.getSection(section)
	if s == nil {
		return nil
	}

	keys := make([]string, len(s.Data))
	for i, items := range s.Data {
		var key string
		if items != nil {
			key = items.Key
		}
		keys[i] = key
	}
	return keys
}
286205
func ToFloat(str string) (float64, error) {
	res, err := strconv.ParseFloat(str, 64)
	if err != nil {
		res = 0.0
	}
	return res, err
}
1173657
func (s *Session) GetFloat(key string, def float64) float64 {
	v, ok := s.Values[key]
	if !ok {
		return def
	}

	return v.(float64)
}
859791
func (ia *Floats64Value) Set(s string) error {
	i, err := strconv.ParseFloat(s, 64)
	if err != nil {
		return err
	}
	*ia = append(*ia, i)
	return nil
}
840059
func SetDefaultFloat(in float64) floatRuleOpt {
	return func(i *rpc.FloatRule) {
		i.Default = in
		i.HasDefault = true
	}
}
644966
func (ini *INI) Sections() []string {
	sections := make([]string, len(ini.sections))
	for i, s := range ini.sections {
		sections[i] = s.Name
	}
	return sections
}
778653
func SetConfigValue(section, key, val string) error {
	Cfg.SetValue(section, key, val)
	if err := goconfig.SaveConfigFile(Cfg, ConfigFile); err != nil {
		return fmt.Errorf("fail to set config value(%s:%s=%s): %v", section, key, val, err)
	}
	return nil
}
420349
func (context *BaseContext) GetFloat(
	key string, defaultValue ...float64) float64 {
	if value, ok := context.userData[key]; ok {
		if value, ok := value.(float64); ok {
			return value
		}
	}
	if len(defaultValue) > 0 {
		return defaultValue[0]
	}
	return 0
}
1274088
func IndexFloat(a, b string) bool {
	ia, _ := strconv.ParseFloat(a, 64)
	ib, _ := strconv.ParseFloat(b, 64)
	return ia < ib
}