fixed24 Class Reference

#include <fixed24.h>

List of all members.

Public Member Functions

 fixed24 ()
 fixed24 (const fixed24 &)
 Default constructor for FIXED24. It does not actually do anything! Copy constructor.
 fixed24 (INT32)
 Constructor.
 fixed24 (short)
 Constructor.
 fixed24 (double)
 Constructor.
fixed24operator= (const fixed24 &)
 Overloading the assignment operator for FIXED24s.
fixed24operator= (const INT32)
 Overloading the assignment operator for FIXED24s.
fixed24operator= (const short)
 Overloading the assignment operator for FIXED24s.
fixed24operator= (const double)
 Overloading the assignment operator for FIXED24s.
fixed24operator+= (const fixed24 &)
 Overloading the plus-equals operator for FIXED24s.
fixed24operator+= (const short)
 Overloading the plus-equals operator for FIXED24s.
fixed24operator-= (const fixed24 &)
 Overloading the minus-equals operator for FIXED24s.
fixed24operator-= (const short)
 Overloading the minus-equals operator for FIXED24s.
fixed24operator *= (const fixed24 &)
 Overloading the times-equals operator for FIXED24s.
fixed24operator *= (const short)
 Overloading the times-equals operator for FIXED24s.
fixed24operator/= (const fixed24 &)
 Overloading the divide-equals operator for FIXED24s.
fixed24operator/= (const short)
 Overloading the divide-equals operator for FIXED24s.
fixed24operator<<= (const UINT32)
 Overloading the left-shift-equals operator for FIXED24s.
fixed24operator>>= (const UINT32)
 Overloading the right-shift-equals operator for FIXED24s.
fixed24operator++ ()
 Overloading the prefix plus-plus operator for FIXED24s.
fixed24 operator++ (INT32)
 Overloading the postfix plus-plus operator for FIXED24s.
fixed24operator-- ()
 Overloading the prefix minus-minus operator for FIXED24s.
fixed24 operator-- (INT32)
 Overloading the postfix minus-minus operator for FIXED24s.
INT32 MakeInt () const
 converts a FIXED24 to an integer.
short MakeShort () const
 converts a FIXED24 to an integer.
double MakeDouble () const
 Makes a double (32-bit signed value) out of a fixed point 24-bit value.
INT32 MakeLong () const
 converts a FIXED24 to a INT32.
xlong MakeXlong () const
 converts a FIXED24 to a INT32.
INT32 GetAsFixed24 (void)
 converts a FIXED24 to an 8.24 bit fixed point value stored in a INT32. (i.e. pulls the 8.24 data word directly out of the FIXED24, though obviously if the storage model in a fixed24 changes in the future we can change this access function to still return a 8.24 INT32)
void SetAsFixed24 (INT32 NewValue)
 Sets a FIXED24 to an 8.24 bit fixed point value stored in a INT32. (i.e. plonks the 8.24 data word directly into the FIXED24, though obviously if the storage model in a fixed24 changes in the future we can change this access function to still accept a 8.24 INT32).

Static Public Member Functions

static fixed24 FromRawLong (INT32 d)
 converts an INT32 to a FIXED24.

Public Attributes

INT32 all

Friends

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


Detailed Description

Definition at line 150 of file fixed24.h.


Constructor & Destructor Documentation

fixed24::fixed24  )  [inline]
 

Definition at line 162 of file fixed24.h.

00162 {};

fixed24::fixed24 const fixed24 initValue  )  [inline]
 

Default constructor for FIXED24. It does not actually do anything! Copy constructor.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/4/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 296 of file fixed24.h.

00297 {
00298     all = initValue.all;
00299 }

fixed24::fixed24 INT32  initValue  )  [inline]
 

Constructor.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/4/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 315 of file fixed24.h.

00316 {
00317     all = SHORT_FIXED24( initValue );
00318 }

fixed24::fixed24 short  initValue  )  [inline]
 

Constructor.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/4/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 334 of file fixed24.h.

00335 {
00336     all = SHORT_FIXED24( initValue );
00337 }

fixed24::fixed24 double  initValue  )  [inline]
 

Constructor.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/6/93
See also:
Fixedasm.h
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 354 of file fixed24.h.

00355 {
00356     *this = DoubleToFixed24(initValue);
00357 }


Member Function Documentation

fixed24 fixed24::FromRawLong INT32  d  )  [inline, static]
 

converts an INT32 to a FIXED24.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/6/93
Parameters:
An INT32 [INPUTS]
A Fixed24 [OUTPUTS]
Returns:
None. Scope: Private - for FIXED_DBL macro If you wish to access the private data in a FIXED24, then please use GetAsFixed24, which is an interface inline function which will always present the data to the outside world in 8.24 bit format, even if we decide to change the internal format one day.

Errors: None.

Definition at line 378 of file fixed24.h.

00379 {
00380     fixed24 temp;
00381 
00382     temp.all = d;
00383     return temp;
00384 }

INT32 fixed24::GetAsFixed24 void   )  [inline]
 

converts a FIXED24 to an 8.24 bit fixed point value stored in a INT32. (i.e. pulls the 8.24 data word directly out of the FIXED24, though obviously if the storage model in a fixed24 changes in the future we can change this access function to still return a 8.24 INT32)

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
A fixed point value stored as 8.24 bits in a INT32 Scope: Sortof private for use in the DocColour system

Errors: None.

Definition at line 406 of file fixed24.h.

00407 {
00408     return((INT32) all);
00409 }

double fixed24::MakeDouble  )  const [inline]
 

Makes a double (32-bit signed value) out of a fixed point 24-bit value.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/6/93
See also:
fixedasm.h
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
double.

Errors: None.

Definition at line 549 of file fixed24.h.

00550 {
00551     return Fixed24ToDouble(*this);
00552 }

INT32 fixed24::MakeInt  )  const [inline]
 

converts a FIXED24 to an integer.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/6/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 451 of file fixed24.h.

00452 {
00453     return (INT32) (all >> F24SHIFT);
00454 }

INT32 fixed24::MakeLong  )  const [inline]
 

converts a FIXED24 to a INT32.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/6/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 490 of file fixed24.h.

00491 {
00492     return all >> F24SHIFT;
00493 }

short fixed24::MakeShort  )  const [inline]
 

converts a FIXED24 to an integer.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/6/93
See also:
Fixedasm.h
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 471 of file fixed24.h.

00472 {
00473     return (short) (all >> F24SHIFT);
00474 }

xlong fixed24::MakeXlong  )  const [inline]
 

converts a FIXED24 to a INT32.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/6/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None.

Errors: None.

Definition at line 509 of file fixed24.h.

00510 {
00511     return xlong( (short) (all >> F24SHIFT) );
00512 }

fixed24 & fixed24::operator *= const short  operand  ) 
 

Overloading the times-equals operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
See also:
Fixed24Mul().
Parameters:
lvalue to be multiplied [INPUTS] multiplier - rhs of assignment.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 834 of file fixed24.cpp.

00835 {                                  
00836     fixed24 temp;
00837     
00838     temp.all = SHORT_FIXED24( operand );
00839     
00840     F24ASSIGNTHIS = Fixed24Mul(*this, temp);
00841     
00842     return *this;
00843 }

fixed24 & fixed24::operator *= const fixed24 operand  ) 
 

Overloading the times-equals operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
See also:
Fixed24Mul().
Parameters:
lvalue to be multiplied [INPUTS] multiplier - rhs of assignment.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 811 of file fixed24.cpp.

00812 {
00813     F24ASSIGNTHIS = Fixed24Mul(*this, operand);
00814     
00815     return *this;
00816 }

fixed24 fixed24::operator++ INT32  dummy  ) 
 

Overloading the postfix plus-plus operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
Parameters:
dummy value to distinguish between pre- and post-fix application. [INPUTS]
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of increment.

Errors: None.

Definition at line 973 of file fixed24.cpp.

00974 {                
00975     fixed24 result = *this;
00976     
00977     this->all += FIXED24_ONE;
00978     
00979     return result;
00980 }

fixed24 & fixed24::operator++  ) 
 

Overloading the prefix plus-plus operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
Parameters:
None. [INPUTS]
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of increment.

Errors: None.

Definition at line 953 of file fixed24.cpp.

00954 {
00955     this->all += FIXED24_ONE;
00956     return *this;
00957 }

fixed24 & fixed24::operator+= const short  operand  ) 
 

Overloading the plus-equals operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
Parameters:
lvalue to be incremented [INPUTS] operand to be added - rhs of assignment.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 747 of file fixed24.cpp.

00748 { 
00749     this->all += SHORT_FIXED24( operand );
00750     return *this;
00751 }

fixed24 & fixed24::operator+= const fixed24 operand  ) 
 

Overloading the plus-equals operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
Parameters:
lvalue to be incremented [INPUTS] operand to be added - rhs of assignment.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 726 of file fixed24.cpp.

00727 { 
00728     this->all += operand.all;
00729     return *this;
00730 }

fixed24 fixed24::operator-- INT32  dummy  ) 
 

Overloading the postfix minus-minus operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
Parameters:
dummy value to distinguish between pre- and post-fix application. [INPUTS]
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of decrement.

Errors: None.

Definition at line 1016 of file fixed24.cpp.

01017 {
01018     fixed24 result = *this;
01019     
01020     this->all -= FIXED24_ONE;
01021     
01022     return result;
01023 }

fixed24 & fixed24::operator--  ) 
 

Overloading the prefix minus-minus operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
Parameters:
None. [INPUTS]
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of decrement.

Errors: None.

Definition at line 996 of file fixed24.cpp.

00997 {
00998     this->all -= FIXED24_ONE;
00999     return *this;
01000 }

fixed24 & fixed24::operator-= const short  operand  ) 
 

Overloading the minus-equals operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
Parameters:
lvalue to be decremented [INPUTS] operand to be subtracted - rhs of assignment.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 789 of file fixed24.cpp.

00790 {
00791     this->all -= SHORT_FIXED24( operand );
00792     return *this;
00793 }

fixed24 & fixed24::operator-= const fixed24 operand  ) 
 

Overloading the minus-equals operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
Parameters:
lvalue to be decremented [INPUTS] operand to be subtracted - rhs of assignment.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 768 of file fixed24.cpp.

00769 {
00770     this->all -= operand.all;
00771     return *this;
00772 }

fixed24 & fixed24::operator/= const short  operand  ) 
 

Overloading the divide-equals operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
See also:
Fixed24Div().
Parameters:
lvalue to be divided [INPUTS] divisor - rhs of assignment.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 884 of file fixed24.cpp.

00885 {
00886     fixed24 temp;
00887     
00888     temp.all = SHORT_FIXED24( operand );
00889     
00890     F24ASSIGNTHIS = Fixed24Div(*this, temp);
00891     
00892     return *this;
00893 }

fixed24 & fixed24::operator/= const fixed24 operand  ) 
 

Overloading the divide-equals operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
See also:
Fixed24Div().
Parameters:
lvalue to be divided [INPUTS] divisor - rhs of assignment.
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 861 of file fixed24.cpp.

00862 {
00863     F24ASSIGNTHIS = Fixed24Div(*this, operand);
00864     
00865     return *this;
00866 }

fixed24 & fixed24::operator<<= const UINT32  operand  ) 
 

Overloading the left-shift-equals operator for FIXED24s.

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

Errors: None.

Definition at line 910 of file fixed24.cpp.

00911 {
00912     this->all <<= operand;
00913     return *this;
00914 }

fixed24 & fixed24::operator= const double  operand  ) 
 

Overloading the assignment operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
See also:
DoubleToFixed24().
Parameters:
operand to be assigned - rhs of assignment. [INPUTS]
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 705 of file fixed24.cpp.

00706 { 
00707     F24ASSIGNTHIS = DoubleToFixed24(operand);
00708     return *this;
00709 }

fixed24 & fixed24::operator= const short  operand  )  [inline]
 

Overloading the assignment operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/4/93
See also:
Fixedasm.h
Parameters:
operand to be assigned - rhs of assignment. [INPUTS]
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 569 of file fixed24.h.

00570 { 
00571     this->all = SHORT_FIXED24( operand );
00572     return *this;
00573 }

fixed24 & fixed24::operator= const INT32  operand  ) 
 

Overloading the assignment operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com> (Jason Williams)
Date:
27/4/93
Parameters:
operand to be assigned - rhs of assignment. [INPUTS]
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 684 of file fixed24.cpp.

00685 {
00686     this->all = SHORT_FIXED24( operand );
00687     return *this;
00688 }

fixed24 & fixed24::operator= const fixed24 operand  )  [inline]
 

Overloading the assignment operator for FIXED24s.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/4/93
Parameters:
operand to be assigned - rhs of assignment. [INPUTS]
None. [OUTPUTS]
Returns:
A reference to an FIXED24 with result of assignment.

Errors: None.

Definition at line 528 of file fixed24.h.

00529 { 
00530     this->all = operand.all;
00531     
00532     return *this; 
00533 }

fixed24 & fixed24::operator>>= const UINT32  operand  ) 
 

Overloading the right-shift-equals operator for FIXED24s.

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

Errors: None.

Definition at line 931 of file fixed24.cpp.

00932 {
00933     this->all >>= operand;
00934     return *this;
00935 } 

void fixed24::SetAsFixed24 INT32  NewValue  )  [inline]
 

Sets a FIXED24 to an 8.24 bit fixed point value stored in a INT32. (i.e. plonks the 8.24 data word directly into the FIXED24, though obviously if the storage model in a fixed24 changes in the future we can change this access function to still accept a 8.24 INT32).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None Scope: Sortof private for use in the DocColour system

Errors: None.

Definition at line 430 of file fixed24.h.

00431 {
00432     all = NewValue;
00433 }


Friends And Related Function Documentation

fixed24 CCAPI operator * const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator!= const fixed24 operand1,
const short  operand2
[friend]
 

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 CCAPI operator!= const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator+ const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator- const fixed24 operand  )  [friend]
 

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 CCAPI operator- const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator/ const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator< const fixed24 operand1,
const short  operand2
[friend]
 

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 CCAPI operator< const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator<< const fixed24 operand1,
UINT32  operand2
[friend]
 

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 CCAPI operator<= const fixed24 operand1,
const short  operand2
[friend]
 

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 CCAPI operator<= const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator== const fixed24 operand1,
const short  operand2
[friend]
 

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 CCAPI operator== const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator> const fixed24 operand1,
const short  operand2
[friend]
 

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 CCAPI operator> const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator>= const fixed24 operand1,
const short  operand2
[friend]
 

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 CCAPI operator>= const fixed24 operand1,
const fixed24 operand2
[friend]
 

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 CCAPI operator>> const fixed24 operand1,
UINT32  operand2
[friend]
 

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 }


Member Data Documentation

INT32 fixed24::all
 

Definition at line 153 of file fixed24.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:54:20 2007 for Camelot by  doxygen 1.4.4