byond math is bad math

This commit is contained in:
SandPoot
2024-04-01 18:10:40 -03:00
parent ad68229b8f
commit 9fcce9f100
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -108,7 +108,8 @@
#define TORADIANS(degrees) ((degrees) * 0.0174532925)
/// Gets shift x that would be required the bitflag (1<<x)
#define TOBITSHIFT(bit) ( log(2, bit) )
/// We need the round because log has floating-point inaccuracy, and if we undershoot at all on list indexing we'll get the wrong index.
#define TOBITSHIFT(bit) ( round(log(2, bit), 1) )
// Will filter out extra rotations and negative rotations
// E.g: 540 becomes 180. -180 becomes 180.