return (static_cast<float>(m_num) / (1 << point_pos));
}
-int Fixed::operator==(const Fixed &other) const
+bool Fixed::operator==(const Fixed &other) const
{
return (m_num == other.m_num);
}
-int Fixed::operator!=(const Fixed &other) const
+bool Fixed::operator!=(const Fixed &other) const
{
return (!(*this == other));
}
-int Fixed::operator>(const Fixed &other) const
+bool Fixed::operator>(const Fixed &other) const
{
return (m_num > other.m_num);
}
-int Fixed::operator<(const Fixed &other) const
+bool Fixed::operator<(const Fixed &other) const
{
return (!(*this >= other));
}
-int Fixed::operator>=(const Fixed &other) const
+bool Fixed::operator>=(const Fixed &other) const
{
return (*this == other || *this > other);
}
-int Fixed::operator<=(const Fixed &other) const
+bool Fixed::operator<=(const Fixed &other) const
{
return (!(*this > other));
}
Fixed &operator=(const Fixed &other);
- int operator==(const Fixed &other) const;
- int operator!=(const Fixed &other) const;
- int operator>=(const Fixed &other) const;
- int operator<=(const Fixed &other) const;
- int operator>(const Fixed &other) const;
- int operator<(const Fixed &other) const;
+ bool operator==(const Fixed &other) const;
+ bool operator!=(const Fixed &other) const;
+ bool operator>=(const Fixed &other) const;
+ bool operator<=(const Fixed &other) const;
+ bool operator>(const Fixed &other) const;
+ bool operator<(const Fixed &other) const;
Fixed operator+(const Fixed &other) const;
Fixed operator-(const Fixed &other) const;