ID:109947
 
Not a bug
BYOND Version:479
Operating System:Windows Vista Home Basic
Web Browser:Chrome 9.0.597.98
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: When using cos trig function cos(90) outputs -4.37114e-008

Numbered Steps to Reproduce Problem:
just output cos(90)

Code Snippet (if applicable) to Reproduce Problem:
client
Click()
usr << cos(90)


Expected Results:
0
Actual Results:
-4.37114e-008
Does the problem occur:
Every time? Or how often? every time
In other games? yes
In other user accounts? not tested
On other computers? not tested

When does the problem NOT occur?
cos(0),sin(90) and sin(0) all give expected results
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
tried a few all ended up with same error

Workarounds:
replace all cos(x) function with sin(90 - x)
This is just normal rounding error that comes as a result of using single-precision floats. Even at double-precision it's impossible to get cos(90) to spit out 0.
oh right, okay thanks. is it not worth creating special cases for cos(90) sin(0) etc to make it equal exactly zero?