Merge pull request #5015 from oneandonlydean/up4/fix-fmin-zero-sign

fix(libSceLibcInternal): return the negative zero from fminf for zeros of different sign
This commit is contained in:
Dean 2026-10-13 21:25:42 +13:00 committed by GitHub
commit ad653c9bc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -143,6 +143,12 @@ unsigned int APS5_VABI alarm_nid_postfix(unsigned int seconds) {
}
float APS5_VABI fminf_nid_postfix(float x, float y) {
return std::fmin(x, y);
if (std::isnan(x))
return y;
if (std::isnan(y))
return x;
if (std::signbit(x) != std::signbit(y))
return std::signbit(x) ? x : y;
return x < y ? x : y;
}
}