PAlib
|
Fixed-point wrapper class. More...
#include <PA_FixedPointClass.h>
Public Member Functions | |
Fixed () | |
Empty constructor. | |
Fixed (const Fixed &a) | |
Copy constructor. | |
Fixed (int a) | |
int constructor. | |
Fixed (float a) | |
float constructor. | |
operator int () const | |
int cast. | |
operator float () const | |
float cast. | |
operator bool () const | |
bool cast. | |
operator char () const | |
char cast. | |
operator short () const | |
short cast. | |
operator long long () const | |
long long cast. | |
Fixed & | operator= (const Fixed &a) |
Assignment operator. | |
Fixed | operator+ (const Fixed &a) const |
Addition operator. int and float versions also available. | |
Fixed | operator- (const Fixed &a) const |
Subtraction operator. int and float versions also available. | |
Fixed | operator* (const Fixed &a) const |
Multiplication operator. int and float versions also available. | |
Fixed | operator/ (const Fixed &a) const |
Division operator. int and float versions also available. | |
Fixed | operator% (const Fixed &a) const |
Modulo operator. int and float versions also available. | |
Fixed | operator++ () |
Pre-increment operator. | |
Fixed | operator-- () |
Pre-decrement operator. | |
Fixed | operator++ (int) |
Post-increment operator. | |
Fixed | operator-- (int) |
Post-decrement operator. | |
Fixed | operator- () const |
Negation operator. | |
Fixed | operator~ () const |
Binary negation operator. | |
Fixed & | operator+= (const Fixed &a) |
Addition and assignment operator. int and float versions also available. | |
Fixed & | operator-= (const Fixed &a) |
Subtraction and assignment operator. int and float versions also available. | |
Fixed & | operator*= (const Fixed &a) |
Multiplication and assignment operator. int and float versions also available. | |
Fixed & | operator%= (const Fixed &a) |
Modulo and assignment operator. int and float versions also available. | |
bool | operator== (const Fixed &a) const |
Equals operator. int and float versions also available. | |
bool | operator!= (const Fixed &a) const |
Not-equals operator. int and float versions also available. | |
bool | operator<= (const Fixed &a) const |
Less-or-equal operator. int and float versions also available. | |
bool | operator>= (const Fixed &a) const |
Greater-or-equal operator. int and float versions also available. | |
bool | operator< (const Fixed &a) const |
Less-than operator. int and float versions also available. | |
bool | operator> (const Fixed &a) const |
Greater-than operator. int and float versions also available. | |
Fixed | operator<< (int a) const |
Left shift operator. | |
Fixed | operator>> (int a) const |
Right shift operator. | |
Fixed & | operator<<= (int a) |
Left shift and assign operator. | |
Fixed & | operator>>= (int a) |
Right shift and assign operator. | |
Fixed | operator& (u32 a) const |
Binary AND operator, u32 version. | |
Fixed | operator| (u32 a) const |
Binary OR operator, u32 version. | |
Fixed | operator^ (u32 a) const |
Binary XOR operator, u32 version. | |
Fixed | operator& (const Fixed &a) const |
Binary AND operator, Fixed version. | |
Fixed | operator| (const Fixed &a) const |
Binary OR operator, Fixed version. | |
Fixed | operator^ (const Fixed &a) const |
Binary XOR operator, Fixed version. | |
Fixed & | operator&= (u32 a) |
Binary AND assignment, u32 version. | |
Fixed & | operator|= (u32 a) |
Binary OR assignment, u32 version. | |
Fixed & | operator^= (u32 a) |
Binary XOR assignment, u32 version. | |
Fixed & | operator&= (const Fixed &a) |
Binary AND assignment, Fixed version. | |
Fixed & | operator|= (const Fixed &a) |
Binary OR assignment, Fixed version. | |
Fixed & | operator^= (const Fixed &a) |
Binary XOR assignment, Fixed version. | |
Fixed | sqrt () const |
Gets the square root. | |
Fixed | abs () const |
Gets the absolute value. | |
int | raw () const |
Gets the raw Q12 fixed point number. | |
Static Public Member Functions | |
static Fixed | r2f (int a) |
Creates a Fixed object using a raw Q12 fixed point number. | |
Fixed-point wrapper class.