fix(libc): accept the full llroundl integer range

This commit is contained in:
QRMOE 2026-10-13 07:46:49 +02:00 committed by GitHub
parent 88107b7de6
commit f745a00a5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ namespace {
template<typename TFloat>
std::int64_t RoundToInt64(TFloat value) {
const TFloat rounded = std::round(value);
if (!(rounded >= static_cast<TFloat>(INT64_MIN) && rounded < static_cast<TFloat>(INT64_MAX))) {
if (!(rounded >= static_cast<TFloat>(INT64_MIN) && rounded < -static_cast<TFloat>(INT64_MIN))) {
std::feraiseexcept(FE_INVALID);
return INT64_MIN;
}