/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Fixed.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/06/20 10:06:37 by narnaud #+# #+# */ /* Updated: 2022/06/20 14:49:38 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once #include #include class Fixed { public: Fixed (void); Fixed (const int init_int); Fixed (const float init_float); Fixed (Fixed const & src); ~Fixed (void); Fixed & operator= (Fixed const & src); int getRawBits(void) const; void setRawBits(int const raw); float toFloat(void) const; int toInt(void) const; private: int _raw_bits; static const int _fract_bits; }; std::ostream & operator << (std::ostream &out, const Fixed &f);