/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   Fixed.class.hpp                                    :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2025/07/16 15:46:39 by bchanot           #+#    #+#             */
/*   Updated: 2025/07/17 17:16:03 by bchanot          ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#ifndef FIXED_CLASS_H
# define FIXED_CLASS_H

#include <iostream>

class	Fixed {
	public:
		Fixed(void);
		Fixed(Fixed const &src);
		Fixed(int const num);
		Fixed(float const num);
		~Fixed(void);

		int			getRawBits(void) const;
		void		setRawBits(int const raw);
		float		toFloat(void) const;
		int			toInt(void) const;

		Fixed		&operator=(Fixed const &rhs);

	private:
		int			_value;
		static int const	_frac = 8;
};

std::ostream	&operator<<(std::ostream &o, Fixed const &i);

#endif
