Going to a math package has the wrong result

I just ran this code on my computer:

package main import ( "fmt" "math" ) func main() { const ali = 4e20 fmt.Println(math.Sin(ali)) } 

and got this result:

 1.3471173831553043e+258 

Why is the result of sin greater than 1?

Python and some other languages ​​have the correct result

+7
math go
source share
1 answer

It seems like this is just an implementation problem, if the input is greater than 2 ** 49, it causes problems. Found a really old problem here

+2
source share

All Articles