MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / FromFloat

Function FromFloat

task/conversion.go:67–71  ·  view source on GitHub ↗

FromFloat converts the given float64 value into a pb.TaskValue object.

(val float64)

Source from the content-addressed store, hash-verified

65
66// FromFloat converts the given float64 value into a pb.TaskValue object.
67func FromFloat(val float64) *pb.TaskValue {
68 bs := make([]byte, 8)
69 binary.LittleEndian.PutUint64(bs, math.Float64bits(val))
70 return &pb.TaskValue{Val: bs, ValType: pb.Posting_FLOAT}
71}
72
73// ToFloat converts the given pb.TaskValue object into an integer.
74// Note, this panics if there are not enough bytes in val.Val

Callers 1

TestSubgraphToFastJSONFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestSubgraphToFastJSONFunction · 0.74