mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-24 16:40:21 +00:00
AK: Fix double promotion error when using AK:ceil on floats
This commit is contained in:
parent
c948777ec4
commit
ce6dacbc46
Notes:
sideshowbarker
2024-07-17 04:05:00 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/ce6dacbc46 Pull-request: https://github.com/SerenityOS/serenity/pull/16149 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/gmta
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…
Reference in a new issue