-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Mathf.Sin(Mathf.PI) returns non zero number #17449
Comments
cc: @neikeq |
Hmm.. I guess your right. The issue was exposed by porting some gdscript that assumed sin() returned positive for the range 0 to PI. First I was using
|
Single precision PI representation is bigger than PI (it's 3.1415927410, real PI is 3.1415926535...). |
That's not a bug, that's just how floating point precision works. You should never assume that any float or double operation will return a pure integer 0. 0 does not exist as the result of a floating point operation, you should always check that |
Godot version:
aeb1c67
OS/device including version:
Window 7
Issue description:
C# Godot's
Mathf.Sin(Mathf.PI)
returns a negative non zero number.Two of the signature characteristics of the sine function are:
Steps to reproduce:
If we attach the following gdscript to a Node:
It will produce this output:
But if we attach this c sharp to a Node:
It will generate this output:
The text was updated successfully, but these errors were encountered: