test: fix ut TestTan due to math.Tan(math.Pi / 4) equals 0.9999999999999998, not 1 (#42421)

close pingcap/tidb#42420
This commit is contained in:
zhangxiaoyu.york
2023-03-21 21:42:42 +08:00
committed by GitHub
parent 2f5d5ff2fd
commit b6d26be524

View File

@ -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},