cpp/CPP02/ex01/Fixed.hpp
2024-12-04 17:29:31 +01:00

30 lines
516 B
C++

#ifndef FIXED_HPP
# define FIXED_HPP
# include <iostream>
# include <string>
# include <cmath>
class Fixed {
public:
Fixed(void);
Fixed(int const raw);
Fixed(float const raw);
Fixed(const Fixed &fixed);
~Fixed();
Fixed& operator=(const Fixed &fixed);
int toInt(void) const;
float toFloat(void) const;
int getRawBits(void) const;
void setRawBits(int const raw);
private:
int rawBits;
const static int bits = 8;
};
std::ostream& operator<<(std::ostream& os, const Fixed& fixed);
#endif