fixed24.cpp File Reference

(r1785/r1282)

#include "camtypes.h"

Go to the source code of this file.

Defines

#define F24ASSIGN(it)   it
#define F24ASSIGNTHIS   *this

Functions

fixed24 operator+ (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the addition operator for FIXED24s.
fixed24 operator- (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the subtract operator for FIXED24s.
fixed24 operator- (const fixed24 &operand)
 Overloading the negation operator for FIXED24s. Should be inline.
fixed24 operator * (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the multiplication operator for FIXED24s.
fixed24 operator/ (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the division operator for FIXED24s.
fixed24 operator>> (const fixed24 &operand1, UINT32 operand2)
 Overloading the >> operator to mean shift right for FIXED24s.
fixed24 operator<< (const fixed24 &operand1, UINT32 operand2)
 Overloading the << operator to mean shift left for FIXED24s.
INT32 operator== (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the equality operator for FIXED24s.
INT32 operator== (const fixed24 &operand1, const short operand2)
 Overloading the equality operator for FIXED24s.
INT32 operator!= (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the inequality operator for FIXED24s.
INT32 operator!= (const fixed24 &operand1, const short operand2)
 Overloading the inequality operator for FIXED24s.
INT32 operator> (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the greater-than operator for FIXED24s.
INT32 operator> (const fixed24 &operand1, const short operand2)
 Overloading the greater-than operator for FIXED24s.
INT32 operator< (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the less-than operator for FIXED24s.
INT32 operator< (const fixed24 &operand1, const short operand2)
 Overloading the less-than operator for FIXED24s.
INT32 operator>= (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the greater-than-equal-to operator for FIXED24s.
INT32 operator>= (const fixed24 &operand1, const short operand2)
 Overloading the greater-than-equal-to operator for FIXED24s.
INT32 operator<= (const fixed24 &operand1, const fixed24 &operand2)
 Overloading the less-than-equal-to operator for FIXED24s.
INT32 operator<= (const fixed24 &operand1, const short operand2)
 Overloading the less-than-equal-to operator for FIXED24s.

Variables

const INT32 FIXED24_ONE = 0x01000000L


Define Documentation

#define F24ASSIGN it   )     it
 

Definition at line 116 of file fixed24.cpp.

#define F24ASSIGNTHIS   *this
 

Definition at line 117 of file fixed24.cpp.


Function Documentation

fixed24 operator * const fixed24 operand1,
const fixed24 operand2
 

Overloading the multiplication operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
See also:
Fixed24Mul(). Friend: FIXED24
Parameters:
Two values to be multiplied togther. [INPUTS]
None. [OUTPUTS]
Returns:
A FIXED24 with result of multiplication.

Errors: None.

Definition at line 323 of file fixed24.cpp.

00324 {
00325     fixed24 result;
00326                   
00327     F24ASSIGN(result) = Fixed24Mul( operand1, operand2 );
00328 
00329     return result;
00330 }

INT32 operator!= const fixed24 operand1,
const short  operand2
 

Overloading the inequality operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
FIXED24 [INPUTS] short
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 491 of file fixed24.cpp.

00492 {
00493     return operand1.all != SHORT_FIXED24( operand2 );
00494 }

INT32 operator!= const fixed24 operand1,
const fixed24 operand2
 

Overloading the inequality operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
Two FIXED24s to be compared. [INPUTS]
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 469 of file fixed24.cpp.

00470 {
00471     return operand1.all != operand2.all;
00472 }

fixed24 operator+ const fixed24 operand1,
const fixed24 operand2
 

Overloading the addition operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93 Friend: FIXED24
Parameters:
Two values to be added together. [INPUTS]
None. [OUTPUTS]
Returns:
A FIXED24 with result of addition.

Errors: None.

Definition at line 250 of file fixed24.cpp.

00251 {
00252     fixed24 result;
00253                   
00254     result.all = operand1.all + operand2.all;
00255                   
00256     return result;
00257 }

fixed24 operator- const fixed24 operand  ) 
 

Overloading the negation operator for FIXED24s. Should be inline.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/93 Friend: FIXED24
Parameters:
A value to be negated. [INPUTS]
None. [OUTPUTS]
Returns:
A FIXED24 with result of negation.

Errors: None.

Definition at line 298 of file fixed24.cpp.

00299 {
00300     fixed24 temp;
00301 
00302     temp.all = -operand.all;
00303 
00304     return temp;
00305 }

fixed24 operator- const fixed24 operand1,
const fixed24 operand2
 

Overloading the subtract operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93 Friend: FIXED24
Parameters:
Two values to be subtracted from each other. [INPUTS]
None. [OUTPUTS]
Returns:
A FIXED24 with result of subtraction.

Errors: None.

Definition at line 274 of file fixed24.cpp.

00275 {
00276     fixed24 result;
00277                   
00278     result.all = operand1.all - operand2.all;
00279                   
00280     return result;
00281 }

fixed24 operator/ const fixed24 operand1,
const fixed24 operand2
 

Overloading the division operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
See also:
Fixed24Div(). Friend: FIXED24
Parameters:
Two values to be divided. [INPUTS]
None. [OUTPUTS]
Returns:
A FIXED24 with result of division.

Errors: None.

Definition at line 348 of file fixed24.cpp.

00349 {
00350     fixed24 result;
00351                   
00352     F24ASSIGN(result) = Fixed24Div( operand1, operand2 );
00353 
00354     return result;
00355 
00356 }

INT32 operator< const fixed24 operand1,
const short  operand2
 

Overloading the less-than operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
FIXED24 [INPUTS] short
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 577 of file fixed24.cpp.

00578 {
00579     return operand1.all < SHORT_FIXED24( operand2 );
00580 }

INT32 operator< const fixed24 operand1,
const fixed24 operand2
 

Overloading the less-than operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
Two FIXED24s to be compared. [INPUTS]
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 555 of file fixed24.cpp.

00556 {
00557     return operand1.all < operand2.all;
00558 }

fixed24 operator<< const fixed24 operand1,
UINT32  operand2
 

Overloading the << operator to mean shift left for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93 Friend: FIXED24
Parameters:
operand1 - value to be shifted. [INPUTS] operand2 - shift count.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of ASL.

Errors: None.

Definition at line 399 of file fixed24.cpp.

00400 {
00401     fixed24 result;
00402     
00403     result.all = operand1.all << operand2;
00404     
00405     return result;
00406 }

INT32 operator<= const fixed24 operand1,
const short  operand2
 

Overloading the less-than-equal-to operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
FIXED24 [INPUTS] short
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 663 of file fixed24.cpp.

00664 {
00665     return operand1.all <= SHORT_FIXED24( operand2 );
00666 }

INT32 operator<= const fixed24 operand1,
const fixed24 operand2
 

Overloading the less-than-equal-to operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
Two FIXED24s to be compared. [INPUTS]
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 641 of file fixed24.cpp.

00642 {
00643     return operand1.all <= operand2.all;
00644 }

INT32 operator== const fixed24 operand1,
const short  operand2
 

Overloading the equality operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
2/6/93 Friend: FIXED24
Parameters:
FIXED24 [INPUTS] INT8
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 448 of file fixed24.cpp.

00449 {
00450     return operand1.all == SHORT_FIXED24( operand2 );
00451 }

INT32 operator== const fixed24 operand1,
const fixed24 operand2
 

Overloading the equality operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
Two FIXED24s to be compared. [INPUTS]
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 426 of file fixed24.cpp.

00427 {
00428     return operand1.all == operand2.all;
00429 }

INT32 operator> const fixed24 operand1,
const short  operand2
 

Overloading the greater-than operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
FIXED24 [INPUTS] short
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 534 of file fixed24.cpp.

00535 {
00536     return operand1.all > SHORT_FIXED24(operand2);
00537 }

INT32 operator> const fixed24 operand1,
const fixed24 operand2
 

Overloading the greater-than operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
Two FIXED24s to be compared. [INPUTS]
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 512 of file fixed24.cpp.

00513 {
00514     return operand1.all > operand2.all;
00515 }

INT32 operator>= const fixed24 operand1,
const short  operand2
 

Overloading the greater-than-equal-to operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
FIXED24 [INPUTS] short
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 620 of file fixed24.cpp.

00621 {
00622     return operand1.all >= SHORT_FIXED24( operand2 );
00623 }

INT32 operator>= const fixed24 operand1,
const fixed24 operand2
 

Overloading the greater-than-equal-to operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
5/5/93 Friend: FIXED24
Parameters:
Two FIXED24s to be compared. [INPUTS]
None. [OUTPUTS]
Returns:
0 - False 1 - True

Errors: None.

Definition at line 598 of file fixed24.cpp.

00599 {
00600     return operand1.all >= operand2.all;
00601 }

fixed24 operator>> const fixed24 operand1,
UINT32  operand2
 

Overloading the >> operator to mean shift right for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93 Friend: FIXED24
Parameters:
operand1 - value to be shifted. [INPUTS] operand2 - shift count.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of ASR.

Errors: None.

Definition at line 374 of file fixed24.cpp.

00375 {
00376     fixed24 result;
00377     
00378     result.all = operand1.all >> operand2;
00379     
00380     return result;
00381 }


Variable Documentation

const INT32 FIXED24_ONE = 0x01000000L
 

Definition at line 120 of file fixed24.cpp.


Generated on Sat Nov 10 03:49:10 2007 for Camelot by  doxygen 1.4.4