// parseFloat64s transforms strings to float64s.
543898
func (k *Key) parseFloat64s(strs []string, addInvalid, returnOnInvalid bool) ([]float64, error) {
	vals := make([]float64, 0, len(strs))
	for _, str := range strs {
		val, err := strconv.ParseFloat(str, 64)
		if err != nil && returnOnInvalid {
			return nil, err
		}
		if err == nil || addInvalid {
			vals = append(vals, val)
		}
	}
	return vals, nil
}
1070578
func Float64s(data []float64) []float64 {
	sort.Float64s(data)
	n := Uniq(sort.Float64Slice(data))
	return data[:n]
}
779036
func floatStringToNs(s string) (int64, error) {
	const zeros = "000000000"
	if point := strings.IndexRune(s, '.'); point >= 0 {
		tail := s[point+1:]
		if fill := 9 - len(tail); fill < 0 {
			tail = tail[:9]
		} else {
			tail += zeros[:fill]
		}
		s = s[:point] + tail
	} else if len(s) > 0 { // Make sure empty string produces an error
		s += zeros
	}
	return strconv.ParseInt(s, 10, 64)
}
187370
func (p *parser) Float64(i int, context string) float64 {
	s := p.String(i, context)
	if p.err != nil {
		return 0
	}
	if s == "" {
		return 0
	}
	v, err := strconv.ParseFloat(s, 64)
	if err != nil {
		p.SetErr(context, s)
	}
	return v
}
631540
func SumFloat64(s []float64) (sum float64) {
	for _, v := range s {
		sum += v
	}
	return
}
39679
func Float64(names []string, value float64, usage string) *float64 {
	return CommandLine.Float64(names, value, usage)
}
143211
func (v Value) Float64() (float64, error) {
	f, err := strconv.ParseFloat(v.String(), 64)
	if err != nil {
		return 0.0, v.invalidTypeError(err, "float64")
	}
	return f, nil
}
930442
func InRangeFloat64(value, left, right float64) bool {
	if left > right {
		left, right = right, left
	}
	return value >= left && value <= right
}
251529
func (e *Event) Float64(key string, f float64) *Event {
	if e == nil {
		return e
	}
	e.buf = enc.AppendFloat64(enc.AppendKey(e.buf, key), f)
	return e
}
349441
func DefaultFloat64(obj interface{}, defaultValue float64) float64 {
	returnValue, ok := obj.(float64)
	if ok {
		return returnValue
	}

	returnValue, err := strconv.ParseFloat(fmt.Sprint(obj), 64)
	if err != nil {
		return defaultValue
	}

	return returnValue
}
460484
func FormatNumberFloat64(x float64, precision int, thousand string, decimalStr string) string {
	return formatNumberString(fmt.Sprintf(fmt.Sprintf("%%.%df", precision), x), precision, thousand, decimalStr)
}
565617
func (l *Literal) Float64() (float64, error) {
	if l.t != Float64 {
		return 0, fmt.Errorf("literal.Float64: literal is of type %v; cannot be converted to a float64", l.t)
	}
	return l.v.(float64), nil
}
865790
func ReverseFloat64(s []float64) []float64 {
	for i, j := 0, len(s)-1; i < len(s)/2; i, j = i+1, j-1 {
		s[i], s[j] = s[j], s[i]
	}
	return s
}
553693
func FmtFloat(f float64) string {
	af := math.Abs(f)
	if f == 0 {
		return "0"
	} else if 1 <= af && af < 10 {
		return fmt.Sprintf("%.1f", f)
	} else if 10 <= af && af <= 1000 {
		return fmt.Sprintf("%.0f", f)
	}

	if af < 1 {
		var p = 8
		for math.Abs(f) < 1 && p >= 0 {
			f *= 1000
			p--
		}
		return FmtFloat(f) + Units[p]
	}

	var p = 7
	for math.Abs(f) > 1000 && p < 16 {
		f /= 1000
		p++
	}
	return FmtFloat(f) + Units[p]
}
789077
func (nn NullNumber) Float64() (float64, error) {
	if nn.IsNil() {
		return 0, errors.New("NullNumber is nil")
	}
	return strconv.ParseFloat(nn.value.(string), 64)
}
1144672
func (fs *FlagSet) Float64(names []string, value float64, usage string) *float64 {
	p := new(float64)
	fs.Float64Var(p, names, value, usage)
	return p
}
156497
func Float64(short string, long string, value float64, usage string) *float64 {
	flagVar := value
	return Float64Var(&flagVar, short, long, value, usage)
}