feat(ex01): it works

This commit is contained in:
Khaïs COLIN 2025-05-14 13:43:07 +02:00
parent baadd5bddc
commit fce90b9a43
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
5 changed files with 163 additions and 0 deletions

30
ex01/Fixed.hpp Normal file
View file

@ -0,0 +1,30 @@
#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;
friend std::ostream &operator<<(std::ostream &stream, const Fixed &fixed);
private:
int value;
static const int fracbits;
};
#endif