We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9a5c2d commit aee3d95Copy full SHA for aee3d95
lpico8lib.c
@@ -65,8 +65,8 @@ static lua_Number sin_helper(lua_Number x) {
65
// - the last two bits are rounded
66
// We use a lookup table of sin(x)-4x generated by PICO-8 to ensure
67
// that we get the exact same results.
68
- auto a = ((x.bits() & 0x4000 ? ~x : x).bits() + 2) & 0x3ffc;
69
- auto ret = lua_Number::frombits(4 * a + sintable[a >> 2]);
+ auto a = ((x.bits() & 0x4000 ? ~x : x).bits() & 0x3fff) + 2;
+ auto ret = lua_Number::frombits((a >> 2 << 4) + sintable[a >> 2]);
70
return x.bits() & 0x8000 ? ret : -ret;
71
}
72
0 commit comments