小编Jus*_*tin的帖子

在golang中是否有固定cos数学函数的解决方案

我试图在golang中使用来自math API的cos函数,但由于某种原因,该函数返回的值不正确.这个问题有一个已知的解决方案吗?

码:

    fmt.Println("cos(pi/2):", math.Cos(math.Pi / 2))
    fmt.Println("sen(pi/2):", math.Sin(math.Pi / 2))
Run Code Online (Sandbox Code Playgroud)

输出:

cos(pi/2):6.123233995736757e-17

森(pi/2):1

trigonometry function go

2
推荐指数
1
解决办法
379
查看次数

标签 统计

function ×1

go ×1

trigonometry ×1