libc: faster sine table lookup

This commit is contained in:
K. Lange 2018-12-05 13:00:21 +09:00
parent 06c3fc3db5
commit e0575b89eb
1 changed files with 2 additions and 2 deletions

View File

@ -466,9 +466,9 @@ double sin(double x) {
if (x < 0.0) {
x += 3.141592654 * 2.0 * 100.0;
}
double z = fmod(x, 3.141592654 * 2.0);
int i = x * 360.0 / (3.141592654 * 2.0);
int i = z * 360.0 / (3.141582654 * 2.0);
i = i % 360;
return bad_sine_table[i];
}