ID:2524704
 
Not a bug
BYOND Version:513.1500
Operating System:Windows 10 Home 64-bit
Web Browser:Chrome 78.0.3904.108
Applies to:Dream Maker
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
cos(90) returns 6.12323e-017 instead of 0.

Code Snippet (if applicable) to Reproduce Problem:
mob/Login()
src << cos(90)

Expected Results:
0

Actual Results:
6.12323e-017
Also appears to be affecting sin() as well.
sin(90) works okay but sin(180) returns 1.22465e-016, lol
Lummox JR resolved issue (Not a bug)
Not actually a bug; this is a limitation of the underlying functions coupled with rounding errors from degrees-to-radians conversion. You can improve the results by doing some reflections around 180, 90, and 45. The code could try to do this internally but at the cost of reduced performance.

Alternatively you could try to round() to the nearest 2**-40 or so which is an exact number in floating point, and that would deal with some inaccuracies when the value of the function is near 0.