1
0
This repository has been archived on 2025-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
CPP_Module_02/ex01/Fixed.hpp

38 lines
1.3 KiB
C++
Raw Permalink Normal View History

2024-11-19 16:31:58 +01:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Fixed.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/09 19:23:08 by adjoly #+# #+# */
/* Updated: 2024/11/19 16:27:15 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <iostream>
class Fixed {
private:
int _number;
static const int _fractBit = 8;
public:
Fixed(void);
Fixed(const int nbr);
Fixed(const float nbr);
Fixed(const Fixed& cpy);
Fixed& operator=(const Fixed&);
~Fixed(void);
int toInt(void) const;
float toFloat(void) const;
int getRawBits( void ) const;
void setRawBits( int const raw );
};
std::ostream &operator<<(std::ostream &file, Fixed const &fixed);