41 #ifndef __ARTKPFLOAT_FIXED_HEADERFILE__ 42 #define __ARTKPFLOAT_FIXED_HEADERFILE__ 47 #pragma warning ( push ) 48 #pragma warning ( disable: 4293 ) // fix warning about shifting in conversion constructor 59 template<
typename MATHBASE>
74 template <
typename OTHER_MATHBASE>
77 if(OTHER_MATHBASE::PBITS<
PBITS)
82 __int64 v64 = ((__int64)nOther.
getFixed()) << (
PBITS-OTHER_MATHBASE::PBITS);
85 assert(
false &&
"Fixed-Point to Fixed-Point conversion failed: the target's range was overflowed");
101 void setInt(
int nV) {
v = MATHBASE::fixedFromInt(nV); }
102 void setFloat(
float nV) {
v = MATHBASE::fixedFromFloat(nV); }
103 void setDouble(
double nV) {
v = MATHBASE::fixedFromDouble(nV); }
109 float getFloat()
const {
return MATHBASE::floatFromFixed(
v); }
110 double getDouble()
const {
return MATHBASE::doubleFromFixed(
v); }
124 {
return MATHBASE::cos(nV.
v); }
164 bool operator==(
int nOther)
const {
return v == MATHBASE::fixedFromInt(nOther); }
165 bool operator!=(
int nOther)
const {
return v != MATHBASE::fixedFromInt(nOther); }
166 bool operator<=(
int nOther)
const {
return v <= MATHBASE::fixedFromInt(nOther); }
167 bool operator>=(
int nOther)
const {
return v >= MATHBASE::fixedFromInt(nOther); }
168 bool operator<(
int nOther)
const {
return v < MATHBASE::fixedFromInt(nOther); }
169 bool operator>(
int nOther)
const {
return v > MATHBASE::fixedFromInt(nOther); }
171 bool operator==(
float nOther)
const {
return v == MATHBASE::fixedFromFloat(nOther); }
172 bool operator!=(
float nOther)
const {
return v != MATHBASE::fixedFromFloat(nOther); }
173 bool operator<=(
float nOther)
const {
return v <= MATHBASE::fixedFromFloat(nOther); }
174 bool operator>=(
float nOther)
const {
return v >= MATHBASE::fixedFromFloat(nOther); }
175 bool operator<(
float nOther)
const {
return v < MATHBASE::fixedFromFloat(nOther); }
176 bool operator>(
float nOther)
const {
return v > MATHBASE::fixedFromFloat(nOther); }
195 {
return artkpFloat_fixed(MATHBASE::multiply(left.
v, MATHBASE::fixedFromFloat(right))); }
197 {
return artkpFloat_fixed(MATHBASE::multiply(MATHBASE::fixedFromFloat(left), right.
v)); }
202 {
return artkpFloat_fixed(MATHBASE::divide(left.
v, MATHBASE::fixedFromFloat(right))); }
204 {
return artkpFloat_fixed(MATHBASE::divide(MATHBASE::fixedFromFloat(left), right.
v)); }
216 #pragma warning ( pop ) 219 #endif //__ARTKPFLOAT_FIXED_HEADERFILE__ artkpFloat_fixed & operator*=(float nV)
artkpFloat_fixed & operator<<=(int nBits)
bool operator>=(int nOther) const
artkpFloat_fixed(const artkpFloat_fixed &nOther)
bool operator<=(const artkpFloat_fixed &nOther) const
friend artkpFloat_fixed cos(const artkpFloat_fixed &nV)
artkpFloat_fixed & operator=(const artkpFloat_fixed &nOther)
artkpFloat_fixed & operator/=(int nV)
bool operator>(int nOther) const
artkpFloat_fixed & operator+=(float nV)
bool operator<(float nOther) const
artkpFloat_fixed & operator/=(const artkpFloat_fixed &nOther)
bool operator==(float nOther) const
bool operator>(float nOther) const
artkpFloat_fixed & operator=(float nV)
bool operator<=(float nOther) const
void inverseSqrt(const artkpFloat_fixed &nOther)
bool operator<=(int nOther) const
artkpFloat_fixed & operator+=(double nV)
artkpFloat_fixed(float nV)
artkpFloat_fixed operator-() const
bool operator!=(float nOther) const
bool operator>(const artkpFloat_fixed &nOther) const
artkpFloat_fixed & operator*=(const artkpFloat_fixed &nOther)
artkpFloat_fixed & operator=(double nV)
bool operator==(int nOther) const
bool operator==(const artkpFloat_fixed &nOther) const
bool operator>=(const artkpFloat_fixed &nOther) const
artkpFloat_fixed & operator=(int nV)
void setDouble(double nV)
friend artkpFloat_fixed operator/(const artkpFloat_fixed &left, const artkpFloat_fixed &right)
bool operator<(const artkpFloat_fixed &nOther) const
bool operator!=(int nOther) const
friend artkpFloat_fixed operator+(const artkpFloat_fixed &left, const artkpFloat_fixed &right)
artkpFloat_fixed & operator*=(int nV)
artkpFloat_fixed & operator/=(double nV)
void inverse(const artkpFloat_fixed &nOther)
artkpFloat_fixed & operator>>=(int nBits)
TFSIMD_FORCE_INLINE const tfScalar & w() const
artkpFloat_fixed(const artkpFloat_fixed< OTHER_MATHBASE > &nOther)
friend artkpFloat_fixed operator*(const artkpFloat_fixed &left, const artkpFloat_fixed &right)
artkpFloat_fixed & operator-=(const artkpFloat_fixed &nOther)
artkpFloat_fixed & operator*=(double nV)
artkpFloat_fixed & operator/=(float nV)
bool operator<(int nOther) const
artkpFloat_fixed & operator-=(int nV)
bool operator!=(const artkpFloat_fixed &nOther) const
artkpFloat_fixed(double nV)
artkpFloat_fixed & operator-=(double nV)
artkpFloat_fixed & operator+=(int nV)
artkpFloat_fixed & operator-=(float nV)
void setArtkpFloat(const artkpFloat_fixed &nOther)
bool operator>=(float nOther) const
artkpFloat_fixed & operator+=(const artkpFloat_fixed &nOther)