// GetFloat returns the value of the specified key as a float64, or returns an error
8603
func (m Metadata) GetFloat(key string) (*float64, error) {
	val, ok := m[key]
	if !ok {
		return nil, ErrMetadataNonexistantKey
	}
	if val.Type != MetadataValueTypeFloat {
		return nil, ErrMetadataUnexpectedValueType
	}
	out, _ := val.Value.(float64)
	return &out, nil
}
1076473
func Float64() float64 {
	mu.Lock()
	res := r.Float64()
	mu.Unlock()
	return res
}
378764
func (j *JsonQuery) Float(s ...string) (float64, error) {
	val, err := rquery(j.blob, s...)
	if err != nil {
		return 0.0, err
	}
	return floatFromInterface(val)
}
1350079
func GetFloat(n ast.Node) (float64, error) {
	if node, ok := n.(*ast.BasicLit); ok && node.Kind == token.FLOAT {
		return strconv.ParseFloat(node.Value, 64)
	}
	return 0.0, fmt.Errorf("Unexpected AST node type: %T", n)
}
992674
func (e *Entity) GetFloat32(name string) (float32, bool) {
	x, ok := e.Get(name).(float32)
	return x, ok
}
1019332
func (f *Queries) MustFloat64(key string, defaults ...float64) float64 {
	if v, ok := f.Values()[key]; ok {
		i, err := strconv.ParseFloat(v[0], 64)
		if err == nil {
			return i
		}
	}
	if len(defaults) > 0 {
		return defaults[0]
	}
	return 0
}
705839
func (f *Feature) PropertyFloat64(key string) (float64, error) {
	if i, ok := (f.Properties[key]).(float64); ok {
		return i, nil
	}
	return 0, fmt.Errorf("type assertion of `%s` to float64 failed", key)
}
399657
func (s *Session) GetFloat32Default(key string, defaultValue float32) float32 {
	if v, err := s.GetFloat32(key); err == nil {
		return v
	}

	return defaultValue
}
840944
func FindFloat64(s []float64, cb func(s float64) bool) (float64, bool) {
	for _, i := range s {
		result := cb(i)

		if result {
			return i, true
		}
	}

	return 0.0, false
}
1072884
func (l *Locking) Float64() (v float64) {
	l.Lock()
	v = l.R.Float64()
	l.Unlock()
	return
}
196391
func (s *Session) GetFloat32(key string) (float32, error) {
	v := s.Get(key)

	if vfloat32, ok := v.(float32); ok {
		return vfloat32, nil
	}

	if vfloat64, ok := v.(float64); ok {
		return float32(vfloat64), nil
	}

	if vint, ok := v.(int); ok {
		return float32(vint), nil
	}

	if vstring, sok := v.(string); sok {
		vfloat64, err := strconv.ParseFloat(vstring, 32)
		if err != nil {
			return -1, err
		}
		return float32(vfloat64), nil
	}

	return -1, fmt.Errorf(errFindParse, "float32", key)
}
1027258
func (c *IniConfigContainer) DefaultFloat(key string, defaultval float64) float64 {
	v, err := c.Float(key)
	if err != nil {
		return defaultval
	}
	return v
}
1352039
func ReadFloatFrom(data []byte) (Argument, int64, error) {
	var f Float
	if err := binary.Read(bytes.NewReader(data), byteOrder, &f); err != nil {
		return nil, 0, errors.Wrap(err, "read float argument")
	}
	return f, 4, nil
}
328114
func (s *Session) GetFloat32(key string) float32 {
	r, _ := s.Get(key).(float32)
	return r
}
654741
func (section *Section) GetFloat(name string) (float64, error) {
	value, err := section.Get(name)
	if err != nil {
		return float64(0), err
	}

	switch value.(type) {
	case *Primative:
		return value.(*Primative).AsFloat()
	}

	return float64(0), errors.New("could not convert non-primative value to float")
}
247741
func (s *Session) GetFloat64Default(key string, defaultValue float64) float64 {
	if v, err := s.GetFloat64(key); err == nil {
		return v
	}

	return defaultValue
}
1104665
func (f Float64) Get() (float64, error) {
	if !f.Present() {
		var zero float64
		return zero, errors.New("value not present")
	}
	return *f.value, nil
}