MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / Prev

Method Prev

pkg/sql/sem/tree/datum.go:893–902  ·  view source on GitHub ↗

Prev implements the Datum interface.

(ctx context.Context, cmpCtx CompareContext)

Source from the content-addressed store, hash-verified

891
892// Prev implements the Datum interface.
893func (d *DFloat) Prev(ctx context.Context, cmpCtx CompareContext) (Datum, bool) {
894 f := float64(*d)
895 if math.IsNaN(f) {
896 return nil, false
897 }
898 if f == math.Inf(-1) {
899 return DNaNFloat, true
900 }
901 return NewDFloat(DFloat(math.Nextafter(f, math.Inf(-1)))), true
902}
903
904// Next implements the Datum interface.
905func (d *DFloat) Next(ctx context.Context, cmpCtx CompareContext) (Datum, bool) {

Callers

nothing calls this directly

Calls 2

NewDFloatFunction · 0.85
DFloatTypeAlias · 0.85

Tested by

no test coverage detected