mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Add bit shift to FixedPoint
This commit is contained in:
parent
5d6e3441fe
commit
30002c2ccb
Notes:
sideshowbarker
2024-07-17 18:08:56 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/30002c2ccb Pull-request: https://github.com/SerenityOS/serenity/pull/12538 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/bgianfo
1 changed files with 22 additions and 0 deletions
|
@ -179,6 +179,16 @@ public:
|
||||||
{
|
{
|
||||||
return create_raw(m_value / other);
|
return create_raw(m_value / other);
|
||||||
}
|
}
|
||||||
|
template<Integral I>
|
||||||
|
constexpr This operator>>(I other) const
|
||||||
|
{
|
||||||
|
return create_raw(m_value >> other);
|
||||||
|
}
|
||||||
|
template<Integral I>
|
||||||
|
constexpr This operator<<(I other) const
|
||||||
|
{
|
||||||
|
return create_raw(m_value << other);
|
||||||
|
}
|
||||||
|
|
||||||
This& operator+=(This const& other)
|
This& operator+=(This const& other)
|
||||||
{
|
{
|
||||||
|
@ -239,6 +249,18 @@ public:
|
||||||
m_value /= other;
|
m_value /= other;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
template<Integral I>
|
||||||
|
This& operator>>=(I other)
|
||||||
|
{
|
||||||
|
m_value >>= other;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
template<Integral I>
|
||||||
|
This& operator<<=(I other)
|
||||||
|
{
|
||||||
|
m_value <<= other;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator==(This const& other) const { return raw() == other.raw(); }
|
bool operator==(This const& other) const { return raw() == other.raw(); }
|
||||||
bool operator!=(This const& other) const { return raw() != other.raw(); }
|
bool operator!=(This const& other) const { return raw() != other.raw(); }
|
||||||
|
|
Loading…
Reference in a new issue