ID:98055
 
Not a bug
BYOND Version:471
Operating System:Windows Vista Home Basic 64-bit
Web Browser:Chrome 5.0.375.99
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.
mob/verb/sintest()
for(var/i = 0 to 360)world<<"sin([i]) = [sin(i)]"
mob/verb/costest()
for(var/i = 0 to 360)world<<"cos([i]) = [cos(i)]"


sin(180) = -8.74228e-008
sin(360) = 1.74846e-007

cos(90) = -4.37114e-008
cos(270) = 1.19249e-008

I don't know if any of the other angle were screwed up. I scanned through for any odd looking ones.
What are they supposed to be?
sin(180) and sin(360) should be 0

cos(90) and cos(270) should be 0
The single-precision floating point math used here simply isn't precise enough to give you perfect results. Even with double precision you'll commonly see values that are very close to 0 or 1 but not exact. This is a limitation of both the routines themselves and the engine.