ajout max for fixed point range

This commit is contained in:
hugogogo
2022-02-12 21:17:35 +01:00
parent 504f6c3524
commit 8bfe663683
4 changed files with 73 additions and 33 deletions

View File

@@ -8,21 +8,24 @@ class Fixed {
public:
Fixed( void ); // default/parametric constructor
Fixed( Fixed const & src ); // copy constructor
~Fixed( void ); // destructor
Fixed( int integer);
Fixed( float const floater );
Fixed(void); // default/parametric constructor
Fixed(Fixed const & src); // copy constructor
~Fixed(void); // destructor
Fixed(int integer);
Fixed(float const floater);
Fixed & operator=( Fixed const & rhs ); // assignement operator
Fixed & operator=(Fixed const & rhs); // assignement operator
int getRawBits( void ) const;
void setRawBits( int const raw );
int getRawBits(void) const;
void setRawBits(int const raw);
void toFloat(void) const;
int toInt(void) const;
private:
int _value;
static int const _frac = 8;
static int const _frac;
static int const _max;
};