ans∈[−2×1018,2×1018]ans\in[-2\times10^{18},2\times10^{18}]ans∈[−2×1018,2×1018],所以注意你的 inf 是否比这个范围大。
inf
以及比大小时 eps 取 1e-6 精度不够。
eps
1e-6