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

Method Int

value.go:96–104  ·  view source on GitHub ↗

Int returns v's underlying value. It panics if v's underlying type is not TypeInt8, TypeInt16, TypeInt32, TypeInt64, TypeDuration, or TypeTime.

()

Source from the content-addressed store, hash-verified

94// Int returns v's underlying value. It panics if v's underlying type is not
95// TypeInt8, TypeInt16, TypeInt32, TypeInt64, TypeDuration, or TypeTime.
96func (v Value) Int() int64 {
97 if !IsSigned(v.Type().ID()) {
98 panic(fmt.Sprintf("super.Value.Int called on %T", v.Type()))
99 }
100 if x, ok := v.native(); ok {
101 return int64(x)
102 }
103 return DecodeInt(v.bytes())
104}
105
106// Float returns v's underlying value. It panics if v's underlying type is not
107// TypeFloat16, TypeFloat32, or TypeFloat64.

Callers 10

AsIntMethod · 0.95
NewConstFromValueFunction · 0.45
semOpMethod · 0.45
accessLogMiddlewareFunction · 0.45
ErrorMethod · 0.45
encodeAnyMethod · 0.45
decodeAnyMethod · 0.45
runMethod · 0.45
formatAnyFunction · 0.45
writePrimitiveMethod · 0.45

Calls 6

TypeMethod · 0.95
nativeMethod · 0.95
bytesMethod · 0.95
IsSignedFunction · 0.85
DecodeIntFunction · 0.85
IDMethod · 0.65

Tested by

no test coverage detected