42_CPP02/ex02/src/Fixed.hpp

30 lines
480 B
C++
Raw Normal View History

2023-08-03 08:01:36 -04:00
#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