math.nextafter() 函数
math.nextafter() 返回在 x 之后向 y 的下一个可表示浮点值。
函数类型签名
(x: float, y: float) => float
有关更多信息,请参见 Function type signatures。
参数
x
(必需) 用于操作的x值。
y
(必填) 操作中使用的y值。
示例
返回下一个可能的浮点值
import "math"
math.nextafter(x: 1.23, y: 4.56)// 1.2300000000000002
在map中使用math.nextafter
import "math"
data
|> map(fn: (r) => ({_time: r._time, _value: math.nextafter(x: r.t1, y: r.t2)}))