Fix the sign of cos(2*n+1)

Also fix the license text.
This commit is contained in:
fp64 2023-02-19 02:30:17 -05:00
parent 3661bb27ce
commit ee98603fe7
2 changed files with 2 additions and 3 deletions

View File

@ -993,7 +993,6 @@ float vfpu_sin(float x) {
return (sign ? -1.0f : +1.0f) * float(int32_t(ret)) * 3.7252903e-09f; // 0x1p-28f
}
// WARNING: not tested.
float vfpu_cos(float x) {
uint32_t bits;
memcpy(&bits, &x, sizeof(x));
@ -1022,7 +1021,7 @@ float vfpu_cos(float x) {
}
sign ^= ((significand << 7) & 0x80000000u);
significand &= 0x00FFFFFFu;
if(significand > 0x00800000u) {
if(significand >= 0x00800000u) {
significand = 0x01000000u - significand;
sign ^= 0x80000000u;
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2012- PPSSPP Project.
// Copyright (c) 2023- PPSSPP Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by