You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using go version go1.2 darwin/amd64, but the issue still exists in the latest go src.
Here is the demo code:
http://play.golang.org/p/K4Fc8ts24u
{{{
a := 387001390666326231482368.000000
fmt.Printf("Sin(a) = %e\n", math.Sin(a))
}}}
The output is
{{{
Sin(a) = 6.944847e+296
}}}
I know that for a large float, it's hard to get the accurate value for math.Sin, but I
expected that the return value should be in range [-1, 1], at least, which I rely on to
produce a reasonable value for other input.
The text was updated successfully, but these errors were encountered:
the sin implementation in the math package might return meaningless if x > 2**49 (which
is 5.6e14).
I wonder if it's worthwhile to switch to the msun library.
by zhuwl08:
The text was updated successfully, but these errors were encountered: