cpp02/ex01/Fixed.hpp

31 lines
508 B
C++
Raw Permalink Normal View History

2025-05-14 13:43:07 +02:00
#ifndef FIXED_HPP
#define FIXED_HPP
#include <iostream>
class Fixed {
public:
Fixed();
Fixed(const int val);
Fixed(const float val);
Fixed(const Fixed &other);
Fixed &operator=(const Fixed &other);
~Fixed();
int getRawBits(void) const;
void setRawBits(int const raw);
float toFloat(void) const;
int toInt(void) const;
std::string toBin(void) const;
private:
int value;
static const int fracbits;
};
2025-05-20 13:34:30 +02:00
std::ostream &operator<<(std::ostream &stream, const Fixed &fixed);
2025-05-14 13:43:07 +02:00
#endif