func (f Float) Value() float64 {
	if f.value != nil {
		return *f.value
	}

	if f.IsNull() {
		return 0
	}

	// A binary length other than 0 (no value), 4, or 8 is not accepted by
	// the parser.
	if binLen := len(f.binary); binLen == 4 || binLen == 8 {
		if binLen == 4 {
			u32 := (uint32(f.binary[3]) << 24) | (uint32(f.binary[2]) << 16) | (uint32(f.binary[1]) << 8) | uint32(f.binary[0])
			f64 := float64(math.Float32frombits(u32))
			f.value = &f64
		} else {
			u64 := (uint64(f.binary[7]) << 56) | (uint64(f.binary[6]) << 48) | (uint64(f.binary[5]) << 40) | (uint64(f.binary[4]) << 32) |
				(uint64(f.binary[3]) << 24) | (uint64(f.binary[2]) << 16) | (uint64(f.binary[1]) << 8) | uint64(f.binary[0])
			f64 := math.Float64frombits(u64)
			f.value = &f64
		}
		return *f.value
	}

	if len(f.text) > 0 {
		text := string(bytes.ReplaceAll(f.text, []byte{'_'}, []byte{}))
		f64, err := strconv.ParseFloat(text, 64)
		// The float value when the given string is too big is
		// +/- infinity.
		if err != nil {
			numErr, ok := err.(*strconv.NumError)
			if !ok || numErr.Err != strconv.ErrRange {
				panic(err)
			}
		}
		f.value = &f64
		return f64
	}

	// It's possible for a binary float to be set to a zero-length slice, in which case
	// the value is not null but there is no binary or text value to parse.
	return 0
}
// Value returns the value of this Float, or 0 if the value is null.
Value returns the value of this Float, or 0 if the value is null.
// Value returns the value of this Float or 0 if the value is null .
func (f Float) Value() float64 {
	if f.value != nil {
		return *f.value
	}
	if f.IsNull() {
		return 0
	}
	if binLen := len(f.binary); binLen == 4 || binLen == 8 {
		if binLen == 4 {
			u32 := (uint32(f.binary[3]) << 24) | (uint32(f.binary[2]) << 16) | (uint32(f.binary[1]) << 8) | uint32(f.binary[0])
			f64 := float64(math.Float32frombits(u32))
			f.value = &f64
		} else {
			u64 := (uint64(f.binary[7]) << 56) | (uint64(f.binary[6]) << 48) | (uint64(f.binary[5]) << 40) | (uint64(f.binary[4]) << 32) |
				(uint64(f.binary[3]) << 24) | (uint64(f.binary[2]) << 16) | (uint64(f.binary[1]) << 8) | uint64(f.binary[0])
			f64 := math.Float64frombits(u64)
			f.value = &f64
		}
		return *f.value
	}
	if len(f.text) > 0 {
		text := string(bytes.ReplaceAll(f.text, []byte{'_'}, []byte{}))
		f64, err := strconv.ParseFloat(text, 64)
		if err != nil {
			numErr, ok := err.(*strconv.NumError)
			if !ok || numErr.Err != strconv.ErrRange {
				panic(err)
			}
		}
		f.value = &f64
		return f64
	}
	return 0
}
func ( f Float ) Value ( ) float64 { if f . value != nil { return * f . value } if f . IsNull ( ) { return 0 } if binLen := len ( f . binary ) ; binLen == 4 || binLen == 8 { if binLen == 4 { u32 := ( uint32 ( f . binary [ 3 ] ) << 24 ) | ( uint32 ( f . binary [ 2 ] ) << 16 ) | ( uint32 ( f . binary [ 1 ] ) << 8 ) | uint32 ( f . binary [ 0 ] ) f64 := float64 ( math . Float32frombits ( u32 ) ) f . value = & f64 } else { u64 := ( uint64 ( f . binary [ 7 ] ) << 56 ) | ( uint64 ( f . binary [ 6 ] ) << 48 ) | ( uint64 ( f . binary [ 5 ] ) << 40 ) | ( uint64 ( f . binary [ 4 ] ) << 32 ) | ( uint64 ( f . binary [ 3 ] ) << 24 ) | ( uint64 ( f . binary [ 2 ] ) << 16 ) | ( uint64 ( f . binary [ 1 ] ) << 8 ) | uint64 ( f . binary [ 0 ] ) f64 := math . Float64frombits ( u64 ) f . value = & f64 } return * f . value } if len ( f . text ) > 0 { text := string ( bytes . ReplaceAll ( f . text , [ ] byte { '_' } , [ ] byte { } ) ) f64 , err := strconv . ParseFloat ( text , 64 ) if err != nil { numErr , ok := err . ( * strconv . NumError ) if ! ok || numErr . Err != strconv . ErrRange { panic ( err ) } } f . value = & f64 return f64 } return 0 }
Value returns the value of this Float, or 0 if the value is null.
Value returns the value of this Float or 0 if the value is null .
// A binary length other than 0 (no value), 4, or 8 is not accepted by // the parser. // The float value when the given string is too big is // +/- infinity. // It's possible for a binary float to be set to a zero-length slice, in which case // the value is not null but there is no binary or text value to parse.