From b6d26be5243ddbf84a155fcabb28ef24d84cdee2 Mon Sep 17 00:00:00 2001 From: "zhangxiaoyu.york" <516302150@qq.com> Date: Tue, 21 Mar 2023 21:42:42 +0800 Subject: [PATCH] test: fix ut TestTan due to math.Tan(math.Pi / 4) equals 0.9999999999999998, not 1 (#42421) close pingcap/tidb#42420 --- expression/builtin_math_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/expression/builtin_math_test.go b/expression/builtin_math_test.go index cbcafc12bb..cd7fbb4a44 100644 --- a/expression/builtin_math_test.go +++ b/expression/builtin_math_test.go @@ -985,8 +985,8 @@ func TestTan(t *testing.T) { }{ {nil, 0, true, false}, {int64(0), float64(0), false, false}, - {math.Pi / 4, float64(1), false, false}, - {-math.Pi / 4, float64(-1), false, false}, + {math.Pi / 4, math.Tan(math.Pi / 4), false, false}, + {-math.Pi / 4, math.Tan(-math.Pi / 4), false, false}, {math.Pi * 3 / 4, math.Tan(math.Pi * 3 / 4), false, false}, // in mysql and golang, it equals -1.0000000000000002, not -1 {"0.000", float64(0), false, false}, {"sdfgsdfg", 0, false, true},