fix(libc): accept the full llroundl integer range
This commit is contained in:
parent
88107b7de6
commit
f745a00a5d
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue