mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
AK: Fix double promotion error when using AK:ceil on floats
This commit is contained in:
parent
c948777ec4
commit
ce6dacbc46
1 changed files with 1 additions and 1 deletions
|
@ -760,7 +760,7 @@ constexpr T ceil(T num)
|
|||
if (is_constant_evaluated()) {
|
||||
if (num < NumericLimits<i64>::min() || num > NumericLimits<i64>::max())
|
||||
return num;
|
||||
return (static_cast<double>(static_cast<i64>(num)) == num)
|
||||
return (static_cast<T>(static_cast<i64>(num)) == num)
|
||||
? static_cast<i64>(num)
|
||||
: static_cast<i64>(num) + ((num > 0) ? 1 : 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue