add: ex02

This commit is contained in:
Camille Chauvet
2023-08-03 14:25:38 +02:00
parent 9fafccf65f
commit bf594f63b0
5 changed files with 145 additions and 25 deletions

View File

@ -18,10 +18,32 @@ class Fixed
Fixed &operator=(const Fixed& src);
bool operator<(const Fixed& src);
bool operator>(const Fixed& src);
bool operator>=(const Fixed& src);
bool operator<=(const Fixed& src);
bool operator==(const Fixed& src);
bool operator!=(const Fixed& src);
Fixed operator-(const Fixed& src);
Fixed operator+(const Fixed& src);
Fixed operator*(const Fixed& src);
Fixed operator/(const Fixed& src);
Fixed &operator++();
Fixed &operator--();
Fixed operator++(int);
Fixed operator--(int);
int getRawBits( void ) const;
void setRawBits( int const raw );
float toFloat(void) const ;
int toInt(void) const ;
static const Fixed& max(const Fixed& f1, const Fixed& f2);
static Fixed& max(Fixed& f1, Fixed& f2);
static const Fixed& min(const Fixed& f1, const Fixed& f2);
static Fixed& min(Fixed& f1, Fixed& f2);
};
std::ostream& operator << (std::ostream &out, const Fixed& fixed);