• 直接比较是会有坑,需要进行减去取绝对值的有效范围如

    func almostEqual(a, b float64) bool {
    	return math.Abs(a-b) <= 0.001
    }