// NewFloatConvertFilter creates a blank FloatConvertFilter
961151
func NewFloatConvertFilter() *FloatConvertFilter {
	ret := &FloatConvertFilter{
		make([]base.Attribute, 0),
		make([]base.FilteredAttribute, 0),
		make(map[base.Attribute]bool),
		make(map[base.Attribute]map[uint64]base.Attribute),
	}
	return ret
}
1239227
func NewFloatRule(key string, req bool, opts ...float64) (*FloatRule, error) {
	// Return error if key is empty
	if key == "" {
		return nil, EmptyKeyError
	}

	f := &FloatRule{
		key:      key,
		required: req,
	}

	if len(opts) > 0 {
		f.default_ = &opts[0]
	}
	return f, nil
}
965294
func (reader PluginConfigReaderWithError) GetFloat(key string, defaultValue float64) (float64, error) {
	key = reader.config.registerKey(key)
	if reader.HasValue(key) {
		return reader.config.Settings.Float(key)
	}
	return defaultValue, nil
}
606808
func NewFloatValue(t int64, v float64) Value {
	return FloatValue{unixnano: t, value: v}
}
86343
func NewPreFilter() (*PreFilter, error) {
	// dyn{4,6} officially disabled for now due to missing
	// dump (get_next_key) from kernel side.
	c := preFilterConfig{
		dyn4Enabled: false,
		dyn6Enabled: false,
		fix4Enabled: true,
		fix6Enabled: true,
	}
	p := &PreFilter{
		revision: 1,
		config:   c,
	}
	// Only needed here given we access pinned maps.
	p.mutex.Lock()
	defer p.mutex.Unlock()
	return p.init()
}
55972
func NewFloatTypeParserToVar(variable *float64) *FloatTypeParser {
	parser := new(FloatTypeParser)
	parser.setter = func(value float64) {
		*variable = value
	}
	return parser
}
1321066
func ConvertFloat32(str string) (float32, error) {
	f, err := strconv.ParseFloat(str, 32)
	if err != nil {
		return 0, err
	}
	return float32(f), nil
}
1123458
func NewFilter(dst Sink, matcher Matcher) Sink {
	return &Filter{dst: dst, matcher: matcher}
}
376369
func (me *DefaultAdapter) LiteralFloat(buf *SqlBuilder, f float64) error {
	if buf.IsPrepared {
		return me.PlaceHolderSql(buf, f)
	}
	buf.WriteString(strconv.FormatFloat(f, 'f', -1, 64))
	return nil
}
435278
func FilterFloat64(s []float64, cb func(s float64) bool) []float64 {
	results := []float64{}

	for _, i := range s {
		result := cb(i)

		if result {
			results = append(results, i)
		}
	}

	return results
}
972405
func ToFloat(v interface{}) float64 {
	switch n := v.(type) {
	case int:
		return float64(n)
	case int8:
		return float64(n)
	case int16:
		return float64(n)
	case int32:
		return float64(n)
	case int64:
		return float64(n)
	case uint:
		return float64(n)
	case uint8:
		return float64(n)
	case uint16:
		return float64(n)
	case uint32:
		return float64(n)
	case uint64:
		return float64(n)
	case float32:
		return float64(n)
	case float64:
		return n
	default:
		return math.NaN()
	}
}
634819
func ToFloat(value interface{}) (float64, error) {
	v := reflect.ValueOf(value)
	switch v.Kind() {
	case reflect.Float32, reflect.Float64:
		return v.Float(), nil
	}
	return 0, fmt.Errorf("cannot convert %v to float64", v.Kind())
}
1338892
func NewFloatFieldDescriptor(nullable NullableColumn, metadata []byte) (
	fd FieldDescriptor,
	remaining []byte,
	err error) {

	if len(metadata) < 1 {
		return nil, nil, errors.New("metadata too short")
	}

	size := uint8(metadata[0])
	if size != 4 {
		return nil, nil, errors.New("invalid float size")
	}

	return newFixedLengthFieldDescriptor(
			mysql_proto.FieldType_FLOAT,
			nullable,
			4,
			func(b []byte) interface{} {
				return float64(LittleEndian.Float32(b))
			}),
		metadata[1:],
		nil
}
700515
func NewFloatSimple(f float64) FloatAttribute {
	result := &FloatSimple{
		NewAttribute(NORMAL, nil, nil),
	}
	result.Set(f)
	return result
}
576886
func NewFloat(name string) *Float {
	v := new(Float)
	Publish(name, v)
	return v
}
1019898
func NewFloatResult(val float64, err error) *FloatCmd {
	var cmd FloatCmd
	cmd.val = val
	cmd.setErr(err)
	return &cmd
}
599300
func NewFloat(value string) (DataType, error) {
	returnValue := new(Float)
	v, err := strconv.ParseFloat(value, 64)
	returnValue.value = v
	return returnValue, err
}