Next implements the Datum interface.
(_ *EvalContext)
| 814 | |
| 815 | // Next implements the Datum interface. |
| 816 | func (d *DFloat) Next(_ *EvalContext) (Datum, bool) { |
| 817 | f := float64(*d) |
| 818 | if math.IsNaN(f) { |
| 819 | return dNegInfFloat, true |
| 820 | } |
| 821 | if f == math.Inf(+1) { |
| 822 | return nil, false |
| 823 | } |
| 824 | return NewDFloat(DFloat(math.Nextafter(f, math.Inf(+1)))), true |
| 825 | } |
| 826 | |
| 827 | var dZeroFloat = NewDFloat(0.0) |
| 828 | var dPosInfFloat = NewDFloat(DFloat(math.Inf(+1))) |