mirror of
https://github.com/RGBCube/serenity
synced 2025-07-29 12:17:36 +00:00
AK: Use correct type when calculating integral exp2()
Previously, integral `exp2()` would produce the incorrect result for exponents above 31.
This commit is contained in:
parent
810bbeaed1
commit
e4715aa82a
2 changed files with 19 additions and 1 deletions
|
@ -15,7 +15,7 @@ namespace AK {
|
|||
template<Integral T>
|
||||
constexpr T exp2(T exponent)
|
||||
{
|
||||
return 1u << exponent;
|
||||
return static_cast<T>(1) << exponent;
|
||||
}
|
||||
|
||||
template<Integral T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue