AnimatLab  2
Test
StdFixed.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 namespace StdUtils
10 {
19 class STD_UTILS_PORT CStdFixed
20 {
21 protected:
24  int m_iM;
25 
28  int m_iN;
29 
35 
41 
43  long m_lFixed;
44 
46  double m_dblVal;
47 
49  float m_fltVal;
50 
52  unsigned long m_lMaxInt;
53 
55  unsigned long m_lMaxReal;
56 
59 
62 
65 
68 
71 
82  long Convert(double dblVal)
83  {
84  return (long) ((dblVal)*m_dblConvertInt);
85  }
86 
97  double Convert(long lVal)
98  {
99  return (lVal*m_dblConvertReal);
100  }
101 
102 public:
103 
111  {
112  m_iM = 0;
113  m_iN = 0;
114  m_iMultiplyM = 0;
115  m_iMultiplyN = 0;
116  m_lFixed = 0;
117  m_lMaxInt = 0;
118  m_lMaxReal = 0;
119  m_dblConvertReal = 0;
120  m_dblConvertInt = 0;
121  m_lAddPosMask = 0;
122  m_lAddNegMask = 0;
123  m_lAddTestMask = 0;
124  m_dblVal = 0;
125  m_fltVal = 0;
126  };
127 
128  CStdFixed(int iM, int iN, int iMultM = -1, int iMultN = -1);
129  CStdFixed(int iM, int iN, double dblVal, int iMultM = -1, int iMultN = -1);
130  CStdFixed(int iM, int iN, long lVal, int iMultM = -1, int iMultN = -1);
131  ~CStdFixed(void);
132 
141  int M() {return m_iM;};
142 
151  int N() {return m_iN;};
152 
161  int MultM() {return m_iMultiplyM;};
162 
171  int MultN() {return m_iMultiplyN;};
172 
181  long FixedVal() {return m_lFixed;};
182 
191  void Fixed(long lVal)
192  {
193  m_lFixed = lVal;
194  m_dblVal = (float) *this;
195  m_fltVal = m_dblVal;
196  }
197 
198 
207  float GetFloat() {return m_fltVal;};
208 
217  float *GetFloatPtr() {return &m_fltVal;};
218 
227  double GetDouble() {return m_dblVal;};
228 
237  double *GetDoublePtr() {return &m_dblVal;};
238 
247  long *GetLongPtr() {return &m_lFixed;};
248 
249  virtual void Configure(int iM, int iN, int iMultM = -1, int iMultN = -1);
250 
251  //Set operators
252 
263  CStdFixed operator=(float fltVal)
264  {
265  Fixed( (long) Convert((double) fltVal));
266  return *this;
267  }
268 
279  CStdFixed operator=(double dblVal)
280  {
281  Fixed( (long) Convert(dblVal));
282  return *this;
283  }
284 
295  CStdFixed operator=(long lVal)
296  {
297  Fixed( (long) lVal);
298  return *this;
299  }
300 
312  {
313  Fixed( (long) iVal);
314  return *this;
315  }
316 
317  //Addition operators
318 
329  CStdFixed operator+(const float fltVal)
330  {
331  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
332  return this->operator+(fxB);
333  }
334 
345  CStdFixed operator+(const double dblVal)
346  {
347  CStdFixed fxB(m_iM, m_iN, dblVal);
348  return this->operator+(fxB);
349  }
350 
361  CStdFixed operator+(const int iVal)
362  {
363  CStdFixed fxB(m_iM, m_iN, (long) iVal);
364  return this->operator+(fxB);
365  }
366 
377  CStdFixed operator+(const long lVal)
378  {
379  CStdFixed fxB(m_iM, m_iN, lVal);
380  return this->operator+(fxB);
381  }
382 
394  {
395  CStdFixed fxC(m_iM, m_iN);
396 
397  long lVal = m_lFixed + fxB.m_lFixed;
398 
399  //If the MSB is 1 then it is a negative value and we need
400  //to make sure we mask it so the other MSB's remain negative.
401  //If the MSB is 0 then it is positive and we mask it to make sure the
402  //other values are 0.
403  if(lVal & m_lAddTestMask)
404  fxC.Fixed(m_lAddNegMask | lVal);
405  else
406  fxC.Fixed(m_lAddPosMask & lVal);
407 
408  return fxC;
409  }
410 
411  //+= operators
412 
423  CStdFixed operator+=(const float fltVal)
424  {
425  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
426  return this->operator+=(fxB);
427  }
428 
439  CStdFixed operator+=(const double dblVal)
440  {
441  CStdFixed fxB(m_iM, m_iN, dblVal);
442  return this->operator+=(fxB);
443  }
444 
455  CStdFixed operator+=(const int iVal)
456  {
457  CStdFixed fxB(m_iM, m_iN, (long) iVal);
458  return this->operator+=(fxB);
459  }
460 
471  CStdFixed operator+=(const long lVal)
472  {
473  CStdFixed fxB(m_iM, m_iN, lVal);
474  return this->operator+=(fxB);
475  }
476 
488  {
489  long lVal = m_lFixed + fxB.m_lFixed;
490 
491  //If the MSB is 1 then it is a negative value and we need
492  //to make sure we mask it so the other MSB's remain negative.
493  //If the MSB is 0 then it is positive and we mask it to make sure the
494  //other values are 0.
495  if(lVal & m_lAddTestMask)
496  this->Fixed(m_lAddNegMask | lVal);
497  else
498  this->Fixed(m_lAddPosMask & lVal);
499 
500  return *this;
501  }
502 
503 
504  //Subtraction operators
505 
516  CStdFixed operator-(const float fltVal)
517  {
518  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
519  return this->operator-(fxB);
520  }
521 
532  CStdFixed operator-(const double dblVal)
533  {
534  CStdFixed fxB(m_iM, m_iN, dblVal);
535  return this->operator-(fxB);
536  }
537 
548  CStdFixed operator-(const int iVal)
549  {
550  CStdFixed fxB(m_iM, m_iN, (long) iVal);
551  return this->operator-(fxB);
552  }
553 
564  CStdFixed operator-(const long lVal)
565  {
566  CStdFixed fxB(m_iM, m_iN, lVal);
567  return this->operator-(fxB);
568  }
569 
581  {
582  CStdFixed fxC(m_iM, m_iN);
583 
584  long lVal = m_lFixed - fxB.m_lFixed;
585 
586  //If the MSB is 1 then it is a negative value and we need
587  //to make sure we mask it so the other MSB's remain negative.
588  //If the MSB is 0 then it is positive and we mask it to make sure the
589  //other values are 0.
590  if(lVal & m_lAddTestMask)
591  fxC.Fixed(m_lAddNegMask | lVal);
592  else
593  fxC.Fixed(m_lAddPosMask & lVal);
594 
595  return fxC;
596  }
597 
598 
599 
600  //-= operators
601 
612  CStdFixed operator-=(const float fltVal)
613  {
614  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
615  return this->operator-=(fxB);
616  }
617 
628  CStdFixed operator-=(const double dblVal)
629  {
630  CStdFixed fxB(m_iM, m_iN, dblVal);
631  return this->operator-=(fxB);
632  }
633 
644  CStdFixed operator-=(const int iVal)
645  {
646  CStdFixed fxB(m_iM, m_iN, (long) iVal);
647  return this->operator-=(fxB);
648  }
649 
660  CStdFixed operator-=(const long lVal)
661  {
662  CStdFixed fxB(m_iM, m_iN, lVal);
663  return this->operator-=(fxB);
664  }
665 
677  {
678  long lVal = m_lFixed - fxB.m_lFixed;
679 
680  //If the MSB is 1 then it is a negative value and we need
681  //to make sure we mask it so the other MSB's remain negative.
682  //If the MSB is 0 then it is positive and we mask it to make sure the
683  //other values are 0.
684  if(lVal & m_lAddTestMask)
685  this->Fixed(m_lAddNegMask | lVal);
686  else
687  this->Fixed(m_lAddPosMask & lVal);
688 
689  return *this;
690  }
691 
692 
693  //Multiplication operators
694 
705  CStdFixed operator*(const float fltVal)
706  {
707  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
708  return this->operator*(fxB);
709  }
710 
721  CStdFixed operator*(const double dblVal)
722  {
723  CStdFixed fxB(m_iM, m_iN, dblVal);
724  return this->operator*(fxB);
725  }
726 
737  CStdFixed operator*(const int iVal)
738  {
739  CStdFixed fxB(m_iM, m_iN, (long) iVal);
740  return this->operator*(fxB);
741  }
742 
753  CStdFixed operator*(const long lVal)
754  {
755  CStdFixed fxB(m_iM, m_iN, lVal);
756  return this->operator*(fxB);
757  }
758 
770  {
771  CStdFixed fxC(m_iMultiplyM, m_iMultiplyN);
772  int iNShift = (m_iN + fxB.m_iN) - m_iMultiplyN;
773 
774  __int64 lC = ((__int64) m_lFixed * (__int64) fxB.m_lFixed);
775  fxC.Fixed((long) (lC >> iNShift));
776  return fxC;
777  }
778 
779 
780 
781  //*= operators
782 
793  CStdFixed operator*=(const float fltVal)
794  {
795  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
796  return this->operator*(fxB);
797  }
798 
809  CStdFixed operator*=(const double dblVal)
810  {
811  CStdFixed fxB(m_iM, m_iN, dblVal);
812  return this->operator*(fxB);
813  }
814 
825  CStdFixed operator*=(const int iVal)
826  {
827  CStdFixed fxB(m_iM, m_iN, (long) iVal);
828  return this->operator*(fxB);
829  }
830 
841  CStdFixed operator*=(const long lVal)
842  {
843  CStdFixed fxB(m_iM, m_iN, lVal);
844  return this->operator*(fxB);
845  }
846 
858  {
859  __int64 lC = ((__int64) m_lFixed * (__int64) fxB.m_lFixed);
860  int iNShift = (m_iN + fxB.m_iN) - m_iMultiplyN;
861 
862  this->Fixed( (long) (lC >> iNShift));
863  return *this;
864  }
865 
866 
867 
868  //Division operators
869 
880  CStdFixed operator/(const float fltVal)
881  {
882  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
883  return this->operator/(fxB);
884  }
885 
896  CStdFixed operator/(const double dblVal)
897  {
898  CStdFixed fxB(m_iM, m_iN, dblVal);
899  return this->operator/(fxB);
900  }
901 
912  CStdFixed operator/(const int iVal)
913  {
914  CStdFixed fxB(m_iM, m_iN, (long) iVal);
915  return this->operator/(fxB);
916  }
917 
928  CStdFixed operator/(const long lVal)
929  {
930  CStdFixed fxB(m_iM, m_iN, lVal);
931  return this->operator/(fxB);
932  }
933 
945  {
946  CStdFixed fxC(m_iMultiplyM, m_iMultiplyN);
947  int iNShift = (m_iN + fxB.m_iN) - m_iMultiplyN;
948 
949  __int64 lC = ((__int64) m_lFixed << iNShift);
950  __int64 lD = lC/((__int64)fxB.m_lFixed);
951  fxC.Fixed( (long) lD);
952  return fxC;
953  }
954 
965  CStdFixed operator/=(const float fltVal)
966  {
967  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
968  return this->operator/=(fxB);
969  }
970 
981  CStdFixed operator/=(const double dblVal)
982  {
983  CStdFixed fxB(m_iM, m_iN, dblVal);
984  return this->operator/=(fxB);
985  }
986 
997  CStdFixed operator/=(const int iVal)
998  {
999  CStdFixed fxB(m_iM, m_iN, (long) iVal);
1000  return this->operator/=(fxB);
1001  }
1002 
1013  CStdFixed operator/=(const long lVal)
1014  {
1015  CStdFixed fxB(m_iM, m_iN, lVal);
1016  return this->operator/=(fxB);
1017  }
1018 
1030  {
1031  int iNShift = (m_iN + fxB.m_iN) - m_iMultiplyN;
1032 
1033  __int64 lC = ((__int64) m_lFixed << iNShift);
1034  __int64 lD = lC/((__int64)fxB.m_lFixed);
1035  this->Fixed( (long) lD);
1036  return *this;
1037  }
1038 
1039  //Cast operators
1040 
1049  operator const float()
1050  {return (float) Convert(m_lFixed);}
1051 
1060  operator const double()
1061  {return (double) Convert(m_lFixed);}
1062 
1071  operator const long()
1072  {return m_lFixed;}
1073 
1082  operator const int()
1083  {return (int) m_lFixed;}
1084 
1085 
1086 
1087  //== operators
1088 
1099  bool operator==(const float fltVal)
1100  {
1101  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
1102  return this->operator==(fxB);
1103  }
1104 
1115  bool operator==(const double dblVal)
1116  {
1117  CStdFixed fxB(m_iM, m_iN, dblVal);
1118  return this->operator==(fxB);
1119  }
1120 
1131  bool operator==(const int iVal)
1132  {
1133  CStdFixed fxB(m_iM, m_iN, (long) iVal);
1134  return this->operator==(fxB);
1135  }
1136 
1147  bool operator==(const long lVal)
1148  {
1149  CStdFixed fxB(m_iM, m_iN, lVal);
1150  return this->operator==(fxB);
1151  }
1152 
1164  {
1165  double dblA = (double) *this;
1166  double dblB = (double) fxB;
1167 
1168  if( dblA == dblB )
1169  return true;
1170  else
1171  return false;
1172  }
1173 
1174 
1175  //< operators
1176 
1187  bool operator<(const float fltVal)
1188  {
1189  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
1190  return this->operator<(fxB);
1191  }
1192 
1203  bool operator<(const double dblVal)
1204  {
1205  CStdFixed fxB(m_iM, m_iN, dblVal);
1206  return this->operator<(fxB);
1207  }
1208 
1219  bool operator<(const int iVal)
1220  {
1221  CStdFixed fxB(m_iM, m_iN, (long) iVal);
1222  return this->operator<(fxB);
1223  }
1224 
1235  bool operator<(const long lVal)
1236  {
1237  CStdFixed fxB(m_iM, m_iN, lVal);
1238  return this->operator<(fxB);
1239  }
1240 
1251  bool operator<( CStdFixed &fxB)
1252  {
1253  double dblA = (double) *this;
1254  double dblB = (double) fxB;
1255 
1256  if( dblA < dblB )
1257  return true;
1258  else
1259  return false;
1260  }
1261 
1262  //<= operators
1263 
1274  bool operator<=(const float fltVal)
1275  {
1276  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
1277  return this->operator<=(fxB);
1278  }
1279 
1290  bool operator<=(const double dblVal)
1291  {
1292  CStdFixed fxB(m_iM, m_iN, dblVal);
1293  return this->operator<=(fxB);
1294  }
1295 
1306  bool operator<=(const int iVal)
1307  {
1308  CStdFixed fxB(m_iM, m_iN, (long) iVal);
1309  return this->operator<=(fxB);
1310  }
1311 
1322  bool operator<=(const long lVal)
1323  {
1324  CStdFixed fxB(m_iM, m_iN, lVal);
1325  return this->operator<=(fxB);
1326  }
1327 
1338  bool operator<=( CStdFixed &fxB)
1339  {
1340  double dblA = (double) *this;
1341  double dblB = (double) fxB;
1342 
1343  if( dblA <= dblB )
1344  return true;
1345  else
1346  return false;
1347  }
1348 
1349 
1350 
1351  //> operators
1352 
1363  bool operator>(const float fltVal)
1364  {
1365  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
1366  return this->operator>(fxB);
1367  }
1368 
1379  bool operator>(const double dblVal)
1380  {
1381  CStdFixed fxB(m_iM, m_iN, dblVal);
1382  return this->operator>(fxB);
1383  }
1384 
1395  bool operator>(const int iVal)
1396  {
1397  CStdFixed fxB(m_iM, m_iN, (long) iVal);
1398  return this->operator>(fxB);
1399  }
1400 
1411  bool operator>(const long lVal)
1412  {
1413  CStdFixed fxB(m_iM, m_iN, lVal);
1414  return this->operator>(fxB);
1415  }
1416 
1427  bool operator>( CStdFixed &fxB)
1428  {
1429  double dblA = (double) *this;
1430  double dblB = (double) fxB;
1431 
1432  if( dblA > dblB )
1433  return true;
1434  else
1435  return false;
1436  }
1437 
1438 
1439 
1440  //>= operators
1441 
1452  bool operator>=(const float fltVal)
1453  {
1454  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
1455  return this->operator>=(fxB);
1456  }
1457 
1468  bool operator>=(const double dblVal)
1469  {
1470  CStdFixed fxB(m_iM, m_iN, dblVal);
1471  return this->operator>=(fxB);
1472  }
1473 
1484  bool operator>=(const int iVal)
1485  {
1486  CStdFixed fxB(m_iM, m_iN, (long) iVal);
1487  return this->operator>=(fxB);
1488  }
1489 
1500  bool operator>=(const long lVal)
1501  {
1502  CStdFixed fxB(m_iM, m_iN, lVal);
1503  return this->operator>=(fxB);
1504  }
1505 
1516  bool operator>=( CStdFixed &fxB)
1517  {
1518  double dblA = (double) *this;
1519  double dblB = (double) fxB;
1520 
1521  if( dblA >= dblB )
1522  return true;
1523  else
1524  return false;
1525  }
1526 
1527 
1528 
1530 
1541  bool operator!=(const float fltVal)
1542  {
1543  CStdFixed fxB(m_iM, m_iN, (double) fltVal);
1544  return this->operator!=(fxB);
1545  }
1546 
1557  bool operator!=(const double dblVal)
1558  {
1559  CStdFixed fxB(m_iM, m_iN, dblVal);
1560  return this->operator!=(fxB);
1561  }
1562 
1573  bool operator!=(const int iVal)
1574  {
1575  CStdFixed fxB(m_iM, m_iN, (long) iVal);
1576  return this->operator!=(fxB);
1577  }
1578 
1589  bool operator!=(const long lVal)
1590  {
1591  CStdFixed fxB(m_iM, m_iN, lVal);
1592  return this->operator!=(fxB);
1593  }
1594 
1605  bool operator!=( CStdFixed &fxB)
1606  {
1607  double dblA = (double) *this;
1608  double dblB = (double) fxB;
1609 
1610  if( dblA != dblB )
1611  return true;
1612  else
1613  return false;
1614  }
1615 
1626  std::ostream& operator<<(std::ostream& output) {return output;};
1627 
1628 };
1629 
1630 } //StdUtils
1631 
1632 //CStdFixed operator+(float &fltA, CStdFixed fxB);
CStdFixed operator+=(const long lVal)
Addition assignment operator.
Definition: StdFixed.h:471
bool operator<(const double dblVal)
Less-than comparison operator.
Definition: StdFixed.h:1203
unsigned long m_lMaxReal
This is the maximum real value attainable by the fixed number.
Definition: StdFixed.h:55
bool operator<=(CStdFixed &fxB)
Less-than-or-equal comparison operator.
Definition: StdFixed.h:1338
CStdFixed operator*(const int iVal)
Multiplication operator.
Definition: StdFixed.h:737
CStdFixed operator/(const long lVal)
Division operator.
Definition: StdFixed.h:928
CStdFixed operator*(const CStdFixed &fxB)
Multiplication operator.
Definition: StdFixed.h:769
CStdFixed operator+=(const CStdFixed &fxB)
Addition assignment operator.
Definition: StdFixed.h:487
CStdFixed operator*=(const int iVal)
Multiplication assignment operator.
Definition: StdFixed.h:825
Standard fixed-point number class.
Definition: StdFixed.h:19
bool operator==(const long lVal)
Equality operator.
Definition: StdFixed.h:1147
CStdFixed operator+=(const int iVal)
Addition assignment operator.
Definition: StdFixed.h:455
CStdFixed operator-=(const CStdFixed &fxB)
Subtraction assignment operator.
Definition: StdFixed.h:676
CStdFixed operator/=(const CStdFixed &fxB)
Division assignment operator.
Definition: StdFixed.h:1029
bool operator!=(const double dblVal)
Inequality operator.
Definition: StdFixed.h:1557
double * GetDoublePtr()
Gets the pointer to the floating-point representation of the number.
Definition: StdFixed.h:237
double m_dblVal
Actual value in double variable.
Definition: StdFixed.h:46
long m_lAddTestMask
Mask that is used to make certain that the number cannot go above the maximum number of bits...
Definition: StdFixed.h:70
float * GetFloatPtr()
Gets the pointer to the floating-point representation of the number.
Definition: StdFixed.h:217
CStdFixed operator-(const long lVal)
Negation operator.
Definition: StdFixed.h:564
CStdFixed operator-=(const long lVal)
Subtraction assignment operator.
Definition: StdFixed.h:660
bool operator<=(const float fltVal)
Less-than-or-equal comparison operator.
Definition: StdFixed.h:1274
bool operator>=(const double dblVal)
Greater-than-or-equal comparison operator.
Definition: StdFixed.h:1468
CStdFixed operator/(const CStdFixed &fxB)
Division operator.
Definition: StdFixed.h:944
CStdFixed operator/=(const long lVal)
Division assignment operator.
Definition: StdFixed.h:1013
float GetFloat()
Gets the floating-point representation of the number.
Definition: StdFixed.h:207
int MultN()
Number of bits to the right of the decimal point during multiplication.
Definition: StdFixed.h:171
CStdFixed operator-=(const float fltVal)
Subtraction assignment operator.
Definition: StdFixed.h:612
bool operator>=(const float fltVal)
Greater-than-or-equal comparison operator.
Definition: StdFixed.h:1452
double m_dblConvertReal
The value to convert a fixed-point number to a floating-point number.
Definition: StdFixed.h:58
int M()
Gets the number of bits to the left of the decimal point.
Definition: StdFixed.h:141
CStdFixed operator*(const long lVal)
Multiplication operator.
Definition: StdFixed.h:753
CStdFixed operator-(const CStdFixed &fxB)
Negation operator.
Definition: StdFixed.h:580
bool operator==(CStdFixed &fxB)
Equality operator.
Definition: StdFixed.h:1163
double m_dblConvertInt
The value to convert a floating-point number to a fixed-point number.
Definition: StdFixed.h:61
bool operator>(const int iVal)
Greater-than comparison operator.
Definition: StdFixed.h:1395
bool operator>(CStdFixed &fxB)
Greater-than comparison operator.
Definition: StdFixed.h:1427
int N()
Gets the number of bits to the right of the decimal point.
Definition: StdFixed.h:151
long m_lAddNegMask
Mask that is used to make certain that the number cannot go above the maximum number of bits...
Definition: StdFixed.h:67
long Convert(double dblVal)
Converts floating-point number to a fixed-point number.
Definition: StdFixed.h:82
CStdFixed operator+(const int iVal)
Addition operator.
Definition: StdFixed.h:361
CStdFixed operator=(float fltVal)
Assignment operator.
Definition: StdFixed.h:263
bool operator>(const double dblVal)
Greater-than comparison operator.
Definition: StdFixed.h:1379
bool operator<=(const int iVal)
Less-than-or-equal comparison operator.
Definition: StdFixed.h:1306
long m_lAddPosMask
Mask that is used to make certain that the number cannot go above the maximum number of bits...
Definition: StdFixed.h:64
float m_fltVal
Actual value in float variable.
Definition: StdFixed.h:49
CStdFixed()
Default constructor.
Definition: StdFixed.h:110
bool operator<=(const long lVal)
Less-than-or-equal comparison operator.
Definition: StdFixed.h:1322
CStdFixed operator=(long lVal)
Assignment operator.
Definition: StdFixed.h:295
CStdFixed operator/=(const float fltVal)
Division assignment operator.
Definition: StdFixed.h:965
int MultM()
Number of bits to the left of the decimal point during multiplication.
Definition: StdFixed.h:161
CStdFixed operator+=(const double dblVal)
Addition assignment operator.
Definition: StdFixed.h:439
bool operator<(const int iVal)
Less-than comparison operator.
Definition: StdFixed.h:1219
CStdFixed operator+(const long lVal)
Addition operator.
Definition: StdFixed.h:377
CStdFixed operator/(const double dblVal)
Division operator.
Definition: StdFixed.h:896
bool operator<(CStdFixed &fxB)
Less-than comparison operator.
Definition: StdFixed.h:1251
void Fixed(long lVal)
Sets the fixed-point representation of the number.
Definition: StdFixed.h:191
long m_lFixed
The fixed-point representation of the number.
Definition: StdFixed.h:43
bool operator>=(CStdFixed &fxB)
Greater-than-or-equal comparison operator.
Definition: StdFixed.h:1516
CStdFixed operator=(double dblVal)
Assignment operator.
Definition: StdFixed.h:279
Namespace for the standard utility objects.
Definition: MarkupSTL.cpp:19
bool operator>=(const long lVal)
Greater-than-or-equal comparison operator.
Definition: StdFixed.h:1500
long FixedVal()
Gets the fixed-point representation of the number.
Definition: StdFixed.h:181
double GetDouble()
Gets the double representation of the number.
Definition: StdFixed.h:227
std::ostream & operator<<(std::ostream &output)
stream output operator.
Definition: StdFixed.h:1626
CStdFixed operator+(const CStdFixed &fxB)
Addition operator.
Definition: StdFixed.h:393
CStdFixed operator-=(const double dblVal)
Subtraction assignment operator.
Definition: StdFixed.h:628
bool operator>(const float fltVal)
Greater-than comparison operator.
Definition: StdFixed.h:1363
unsigned long m_lMaxInt
This is the maximum integer value attainable by the fixed number.
Definition: StdFixed.h:52
CStdFixed operator+(const float fltVal)
Addition operator.
Definition: StdFixed.h:329
CStdFixed operator*(const double dblVal)
Multiplication operator.
Definition: StdFixed.h:721
bool operator>=(const int iVal)
Greater-than-or-equal comparison operator.
Definition: StdFixed.h:1484
double Convert(long lVal)
Converts a fixed-point number to a floating-point number.
Definition: StdFixed.h:97
bool operator==(const int iVal)
Equality operator.
Definition: StdFixed.h:1131
CStdFixed operator/(const float fltVal)
Division operator.
Definition: StdFixed.h:880
bool operator!=(CStdFixed &fxB)
Inequality operator.
Definition: StdFixed.h:1605
bool operator<=(const double dblVal)
Less-than-or-equal comparison operator.
Definition: StdFixed.h:1290
CStdFixed operator*=(const CStdFixed &fxB)
Multiplication assignment operator.
Definition: StdFixed.h:857
CStdFixed operator/=(const double dblVal)
Division assignment operator.
Definition: StdFixed.h:981
bool operator!=(const long lVal)
Inequality operator.
Definition: StdFixed.h:1589
bool operator<(const float fltVal)
Less-than comparison operator.
Definition: StdFixed.h:1187
CStdFixed operator*(const float fltVal)
Multiplication operator.
Definition: StdFixed.h:705
bool operator==(const double dblVal)
Equality operator.
Definition: StdFixed.h:1115
CStdFixed operator+=(const float fltVal)
Addition assignment operator.
Definition: StdFixed.h:423
CStdFixed operator*=(const double dblVal)
Multiplication assignment operator.
Definition: StdFixed.h:809
bool operator<(const long lVal)
Less-than comparison operator.
Definition: StdFixed.h:1235
bool operator!=(const float fltVal)
= operators
Definition: StdFixed.h:1541
bool operator!=(const int iVal)
Inequality operator.
Definition: StdFixed.h:1573
bool operator==(const float fltVal)
Equality operator.
Definition: StdFixed.h:1099
CStdFixed operator/(const int iVal)
Division operator.
Definition: StdFixed.h:912
CStdFixed operator+(const double dblVal)
Addition operator.
Definition: StdFixed.h:345
CStdFixed operator-(const int iVal)
Negation operator.
Definition: StdFixed.h:548
CStdFixed operator*=(const float fltVal)
Multiplication assignment operator.
Definition: StdFixed.h:793
CStdFixed operator=(int iVal)
Assignment operator.
Definition: StdFixed.h:311
CStdFixed operator-=(const int iVal)
Subtraction assignment operator.
Definition: StdFixed.h:644
CStdFixed operator-(const float fltVal)
Negation operator.
Definition: StdFixed.h:516
CStdFixed operator/=(const int iVal)
Division assignment operator.
Definition: StdFixed.h:997
CStdFixed operator-(const double dblVal)
Negation operator.
Definition: StdFixed.h:532
CStdFixed operator*=(const long lVal)
Multiplication assignment operator.
Definition: StdFixed.h:841
bool operator>(const long lVal)
Greater-than comparison operator.
Definition: StdFixed.h:1411
long * GetLongPtr()
Gets the pointer to the fixed-point representation of the number.
Definition: StdFixed.h:247