This commit is contained in:
Camille Chauvet
2023-08-03 14:01:36 +02:00
commit 0008b7624a
18 changed files with 379 additions and 0 deletions

29
ex02/src/Fixed.hpp Normal file
View File

@ -0,0 +1,29 @@
#ifndef FIXED_H
# define FIXED_H
# include <ostream>
class Fixed
{
private:
int _value;
static const int _nb_bits = 8;
public:
Fixed();
Fixed(const Fixed& src);
Fixed(const int &n);
Fixed(const float &f);
~Fixed();
Fixed &operator=(const Fixed& src);
int getRawBits( void ) const;
void setRawBits( int const raw );
float toFloat(void) const ;
int toInt(void) const ;
};
std::ostream& operator << (std::ostream &out, const Fixed& fixed);
#endif