MCPcopy Create free account
hub / github.com/brimdata/super / Float

Method Float

value.go:108–116  ·  view source on GitHub ↗

Float returns v's underlying value. It panics if v's underlying type is not TypeFloat16, TypeFloat32, or TypeFloat64.

()

Source from the content-addressed store, hash-verified

106// Float returns v's underlying value. It panics if v's underlying type is not
107// TypeFloat16, TypeFloat32, or TypeFloat64.
108func (v Value) Float() float64 {
109 if !IsFloat(v.Type().ID()) {
110 panic(fmt.Sprintf("super.Value.Float called on %T", v.Type()))
111 }
112 if x, ok := v.native(); ok {
113 return math.Float64frombits(x)
114 }
115 return DecodeFloat(v.bytes())
116}
117
118// Bool returns v's underlying value. It panics if v's underlying type is not
119// TypeBool.

Callers 15

NewConstFromValueFunction · 0.80
encodeAnyMethod · 0.80
decodeAnyMethod · 0.80
EvalMethod · 0.80
CompareInt64Function · 0.80
CompareFloat64Function · 0.80
ComparisonFunction · 0.80
compareNumbersFunction · 0.80
EvalMethod · 0.80
CallMethod · 0.80
CallMethod · 0.80
CallMethod · 0.80

Calls 6

TypeMethod · 0.95
nativeMethod · 0.95
bytesMethod · 0.95
IsFloatFunction · 0.85
DecodeFloatFunction · 0.85
IDMethod · 0.65

Tested by

no test coverage detected