// ReadFloat32 from the reader
433927
func (r *Reader) ReadFloat32() float32 {
	tag := r.readByte()
	decoder := float32Decoders[tag]
	if decoder == nil {
		castError(tag, "float32")
	}
	return decoder(r)
}
557929
func (w *ByteWriter) MustWriteFloat32(val float32, offset int) int {
	return w.MustWriteVal(val, offset)
}
992674
func (e *Entity) GetFloat32(name string) (float32, bool) {
	x, ok := e.Get(name).(float32)
	return x, ok
}
914193
func ReadFloatArray(r io.Reader, byteOrder binary.ByteOrder, array []float64) error {
	buf := make([]byte, 8*len(array))
	if _, err := io.ReadFull(r, buf); err != nil {
		return err
	}
	// Convert to an array of floats
	for i := range array {
		array[i] = readFloat(buf[8*i:], byteOrder)
	}
	return nil
}
9392
func (c *secureCookies) MustFloat32(key string, defaults ...float32) float32 {
	ck, err := c.req.Cookie(key)
	if err != nil {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return 0
	}
	s := parseSecureCookie(c.secret, ck.Value)
	v, err := strconv.ParseFloat(s, 32)
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}
	return float32(v)
}
454724
func (ctx *Context) FormFloat32(key string, defaults ...float32) float32 {
	return (*Forms)(ctx.req).MustFloat32(key, defaults...)
}
577551
func ParamFloat32(r *http.Request, name string, defaultValue float32) float32 {
	value, err := strconv.ParseFloat(r.FormValue(name), 10)
	if err != nil {
		return defaultValue
	}
	return float32(value)
}
1061491
func (d *msgpackDecDriver) DecodeFloat64() (f float64) {
	if !d.bdRead {
		d.readNextBd()
	}
	if d.bd == mpFloat {
		f = float64(math.Float32frombits(bigen.Uint32(d.r.readx(4))))
	} else if d.bd == mpDouble {
		f = math.Float64frombits(bigen.Uint64(d.r.readx(8)))
	} else {
		f = float64(d.DecodeInt64())
	}
	d.bdRead = false
	return
}
1014974
func readFloat(s []byte) (mantissa uint64, exp int, neg, trunc, ok bool) {
	const uint64digits = 19
	i := 0

	// optional sign
	if i >= len(s) {
		return
	}
	switch {
	case s[i] == '+':
		i++
	case s[i] == '-':
		neg = true
		i++
	}

	// digits
	sawdot := false
	sawdigits := false
	nd := 0
	ndMant := 0
	dp := 0
	for ; i < len(s); i++ {
		switch c := s[i]; true {
		case c == '.':
			if sawdot {
				return
			}
			sawdot = true
			dp = nd
			continue

		case '0' <= c && c <= '9':
			sawdigits = true
			if c == '0' && nd == 0 { // ignore leading zeros
				dp--
				continue
			}
			nd++
			if ndMant < uint64digits {
				mantissa *= 10
				mantissa += uint64(c - '0')
				ndMant++
			} else if s[i] != '0' {
				trunc = true
			}
			continue
		}
		break
	}
	if !sawdigits {
		return
	}
	if !sawdot {
		dp = nd
	}

	// optional exponent moves decimal point.
	// if we read a very large, very long number,
	// just be sure to move the decimal point by
	// a lot (say, 100000).  it doesn't matter if it's
	// not the exact number.
	if i < len(s) && (s[i] == 'e' || s[i] == 'E') {
		i++
		if i >= len(s) {
			return
		}
		esign := 1
		if s[i] == '+' {
			i++
		} else if s[i] == '-' {
			i++
			esign = -1
		}
		if i >= len(s) || s[i] < '0' || s[i] > '9' {
			return
		}
		e := 0
		for ; i < len(s) && '0' <= s[i] && s[i] <= '9'; i++ {
			if e < 10000 {
				e = e*10 + int(s[i]) - '0'
			}
		}
		dp += e * esign
	}

	if i != len(s) {
		return
	}

	exp = dp - ndMant
	ok = true
	return

}
1340704
func (s *Session) PopFloat32(key string) float32 {
	r, _ := s.Pop(key).(float32)
	return r
}
463869
func (iter *Iterator) ReadFloat64() (ret float64) {
	c := iter.nextToken()
	if c == '-' {
		return -iter.readPositiveFloat64()
	}
	iter.unreadByte()
	return iter.readPositiveFloat64()
}
445962
func ReverseFloat32(s []float32) []float32 {
	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
}
1133161
func (f *Flash) GetFloat32(key string) float32 {
	r, _ := f.Get(key).(float32)
	return r
}
1319442
func (c Context) Floats32(key string, f []float32) Context {
	c.l.context = enc.AppendFloats32(enc.AppendKey(c.l.context, key), f)
	return c
}
300462
func (r *Reader) ReadFloat64() float64 {
	tag := r.readByte()
	decoder := float64Decoders[tag]
	if decoder == nil {
		castError(tag, "float64")
	}
	return decoder(r)
}
506260
func (lr *LockedRand) Float32() (n float32) {
	lr.lk.Lock()
	n = lr.r.Float32()
	lr.lk.Unlock()
	return
}
601769
func (c *cookies) MustFloat32(key string, defaults ...float32) float32 {
	ck, err := c.req.Cookie(key)
	if err != nil {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return 0
	}
	v, err := strconv.ParseFloat(ck.Value, 32)
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}
	return float32(v)
}