Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math: Calls to math.Sin and math.Cos with values > 1e17 return values outside of [-1,1] #8526

Closed
gopherbot opened this issue Aug 14, 2014 · 1 comment

Comments

@gopherbot
Copy link

by juanval:

go version go1.3 darwin/amd64

What steps reproduce the problem?
Example: http://play.golang.org/p/-GqZSloAM3

    1. fmt.Println(math.Sin(1.5e17))

What happened?

    Program prints "1.231298118089368e+08"

What should have happened instead?

    Program should print value in [-1,1] range

Please provide any additional information below.

    Source code for math.Sin warns that "Results may be meaningless for x > 2**49 = 5.6e14". However, it says nothing about not respecting the [-1,1] range. 

    I discovered this when doing math.Sin(float64(time.Now().UnixNano())) returned 1.1828933275348654e+20

    Also, that information does not appear in godoc.
@minux
Copy link
Member

minux commented Aug 14, 2014

Comment 1:

Status changed to Duplicate.

Merged into issue #6794.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants