Q10
Defines a "floating point number" with 10 bits reserved for the fractional part of the decimal number. Q10 implements some simple arithmetic operations, most yielding a Q10 number and some yielding a Q5 number or a Q15 number as a result.
Public Functions
operator int() const | |
Gets the Q10 as an integer without conversion. | |
Q15 | operator*(const Q5 & q5) const |
Multiplication operator. | |
Q10 | operator+(const Q10 & q10) const |
Addition operator. | |
Q10 | operator-() const |
Negation operator. | |
Q5 | operator/(const Q5 & q5) const |
Division operator. | |
Q10() | |
Initializes a new instance of the Q10 class. | |
Q10(int i) | |
Constructor from integer. | |
template \<typename T \> T | to() const |
Converts the Q10 value to an int or a float. | |
Public Functions Documentation
operator int
operator int | ( | ) | const |
operator*
operator+
operator-
Q10 operator- | ( | ) | const |
Negation operator.
Returns:
The negative value of this.
operator/
Q10
Q10
explicit Q10 | ( | int | i | ) | |
to
T to | ( | ) | const |