ex02 done

This commit is contained in:
2025-09-12 13:08:26 +02:00
parent 80b0e4b146
commit 25147d5d2d
3 changed files with 145 additions and 28 deletions

View File

@@ -55,19 +55,33 @@ class Fixed
int toInt( void ) const;
// · Comparison operators
bool Fixed::operator<(const Fixed &other);
bool Fixed::operator<=(const Fixed &other);
bool Fixed::operator>(const Fixed &other);
bool Fixed::operator>=(const Fixed &other);
bool Fixed::operator==(const Fixed &other);
bool Fixed::operator!=(const Fixed &other);
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;
// · Arithmetic operators
Fixed operator+(Fixed const &other) const;
Fixed operator-(Fixed const &other) const;
Fixed operator*(Fixed const &other) const;
Fixed operator/(Fixed const &other) const;
// · Increments / decrements
Fixed& operator++();
Fixed operator++(int);
Fixed& operator--();
Fixed operator--(int);
// · Max and min
static Fixed& min(Fixed &a, Fixed &b);
static const Fixed& min(const Fixed &a, const Fixed &b);
static Fixed& max(Fixed &a, Fixed &b);
static const Fixed& max(const Fixed &a, const Fixed &b);
};