Prev implements the Datum interface.
(ctx context.Context, cmpCtx CompareContext)
| 891 | |
| 892 | // Prev implements the Datum interface. |
| 893 | func (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. |
| 905 | func (d *DFloat) Next(ctx context.Context, cmpCtx CompareContext) (Datum, bool) { |