pgFix Class Reference
[pgMath -- Mathematics module]

A 32-bit fixed point number. More...

#include <pg_fix.h>

List of all members.

Public Member Functions

 pgDefineException (ExceptionOverflow)
 pgDefineException (ExceptionUnderflow)
 pgFix ()
 Constructs a pgFix.
 pgFix (s32 n)
 Constructs and initialize a pgFix from the specified s32 value.
 pgFix (r32 r)
 Constructs and initialize a pgFix from the specified r32 value.
bool operator== (pgFix fix) const
 Returns whether this pgFix is equal to the right hand side pgFix.
bool operator!= (pgFix fix) const
 Returns whether this pgFix is unequal to the right hand side pgFix.
bool operator< (pgFix fix) const
 Returns whether this pgFix is less than the right hand side pgFix.
bool operator> (pgFix fix) const
 Returns whether this pgFix is greater than the right hand side pgFix.
bool operator<= (pgFix fix) const
 Returns whether this pgFix is less than or equal to the right hand side pgFix.
bool operator>= (pgFix fix) const
 Returns whether this pgFix is greater than or equal to the right hand side pgFix.
pgFix operator+ (pgFix fix) const
 Returns a pgFix which is the sum of this pgFix and the right hand side pgFix.
void operator+= (pgFix fix)
 Adds the right hand side pgFix to this pgFix.
pgFix operator- () const
 Returns a pgFix which is the negative of this pgFix.
pgFix operator- (pgFix fix) const
 Returns a pgFix which is the right hand side pgFix subtracted from this pgFix.
void operator-= (pgFix fix)
 Subtracts the right hand side pgFix from this pgFix.
pgFix operator* (pgFix fix) const
 Returns a pgFix which is this pgFix multiplied with the right hand side pgFix.
void operator*= (pgFix fix)
 Multiplies this pgFix with the right hand side pgFix.
pgFix operator/ (pgFix fix) const
 Returns a pgFix which is this pgFix divided by the right hand side pgFix.
void operator/= (pgFix fix)
 Divides this pgFix by the right hand side pgFix.
s32 toS32 () const
 Returns an s32 value which is converted from this pgFix.
r32 toR32 () const
 Returns an r32 value which is converted from this pgFix.
s32 getValue () const
 Returns the value of this pgFix in the internal format.

Static Public Member Functions

static pgFix fromValue (s32 value)
 Returns a pgFix which is constructed from the specified value in the internal format.

Friends

PG_API friend pgFix operator+ (s32 n, pgFix fix)
 Returns a pgFix which is the sum of the left hand side s32 value and the right hand side pgFix.
PG_API friend pgFix operator+ (r32 r, pgFix fix)
 Returns a pgFix which is the sum of the left hand side r32 value and the right hand side pgFix.
PG_API friend pgFix operator- (s32 n, pgFix fix)
 Returns a pgFix which is the right hand side pgFix subtracted from the left hand side s32 value.
PG_API friend pgFix operator- (r32 r, pgFix fix)
 Returns a pgFix which is the right hand side pgFix subtracted from the left hand side r32 value.
PG_API friend pgFix operator* (s32 n, pgFix fix)
 Returns a pgFix which is the left hand side s32 value multiplied with the right hand side pgFix.
PG_API friend pgFix operator* (r32 r, pgFix fix)
 Returns a pgFix which is the left hand side r32 value multiplied with the right hand side pgFix.
PG_API friend pgFix operator/ (s32 n, pgFix fix)
 Returns a pgFix which is the left hand side s32 value divided by the right hand side pgFix.
PG_API friend pgFix operator/ (r32 r, pgFix fix)
 Returns a pgFix which is the left hand side r32 value divided by the right hand side pgFix.


Detailed Description

A 32-bit fixed point number.

Constructor & Destructor Documentation

pgFix::pgFix ( s32  n  ) 

Constructs and initialize a pgFix from the specified s32 value.

Parameters:
[in] n An s32 value.

pgFix::pgFix ( r32  r  ) 

Constructs and initialize a pgFix from the specified r32 value.

Parameters:
[in] r An r32 value.


Member Function Documentation

static pgFix pgFix::fromValue ( s32  value  )  [static]

Returns a pgFix which is constructed from the specified value in the internal format.

Parameters:
[in] value A value in the internal format.
Returns:
A pgFix which is constructed from the specified value in the internal format.

s32 pgFix::getValue (  )  const

Returns the value of this pgFix in the internal format.

Returns:
The value of thie pgFix in the internal format.

bool pgFix::operator!= ( pgFix  fix  )  const

Returns whether this pgFix is unequal to the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
Whether this pgFix is unequal to the right hand side pgFix.

pgFix pgFix::operator* ( pgFix  fix  )  const

Returns a pgFix which is this pgFix multiplied with the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
A pgFix which is this pgFix multiplied with the right hand side pgFix.

void pgFix::operator*= ( pgFix  fix  ) 

Multiplies this pgFix with the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.

pgFix pgFix::operator+ ( pgFix  fix  )  const

Returns a pgFix which is the sum of this pgFix and the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
A pgFix which is the sum of two pgFixes.

void pgFix::operator+= ( pgFix  fix  ) 

Adds the right hand side pgFix to this pgFix.

Parameters:
[in] fix The right hand side pgFix.

pgFix pgFix::operator- ( pgFix  fix  )  const

Returns a pgFix which is the right hand side pgFix subtracted from this pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
A pgFix which is the right hand side pgFix subtracted from this pgFix.

pgFix pgFix::operator- (  )  const

Returns a pgFix which is the negative of this pgFix.

Returns:
A pgFix which is the negative of this pgFix.

void pgFix::operator-= ( pgFix  fix  ) 

Subtracts the right hand side pgFix from this pgFix.

Parameters:
[in] fix The right hand side pgFix.

pgFix pgFix::operator/ ( pgFix  fix  )  const

Returns a pgFix which is this pgFix divided by the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
A pgVec which is this pgFix divided by the right hand side pgFix.

void pgFix::operator/= ( pgFix  fix  ) 

Divides this pgFix by the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.

bool pgFix::operator< ( pgFix  fix  )  const

Returns whether this pgFix is less than the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
Whether this pgFix is less than the pgFix.

bool pgFix::operator<= ( pgFix  fix  )  const

Returns whether this pgFix is less than or equal to the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
Whether this pgFix is less than or equal to the pgFix.

bool pgFix::operator== ( pgFix  fix  )  const

Returns whether this pgFix is equal to the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
Whether this pgFix is equal to the right hand side pgFix.

bool pgFix::operator> ( pgFix  fix  )  const

Returns whether this pgFix is greater than the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
Whether this pgFix is greater than the pgFix.

bool pgFix::operator>= ( pgFix  fix  )  const

Returns whether this pgFix is greater than or equal to the right hand side pgFix.

Parameters:
[in] fix The right hand side pgFix.
Returns:
Whether this pgFix is greater than or equal to the pgFix.

r32 pgFix::toR32 (  )  const

Returns an r32 value which is converted from this pgFix.

Returns:
An r32 value which is converted from this pgFix.

s32 pgFix::toS32 (  )  const

Returns an s32 value which is converted from this pgFix.

Returns:
An s32 value which is converted from this pgFix.


Friends And Related Function Documentation

PG_API friend pgFix operator* ( r32  r,
pgFix  fix 
) [friend]

Returns a pgFix which is the left hand side r32 value multiplied with the right hand side pgFix.

Parameters:
[in] r The left hand side r32 value.
[in] fix The right hand side pgFix.
Returns:
A pgFix which is the left hand side r32 value multiplied with the right hand side pgFix.

PG_API friend pgFix operator* ( s32  n,
pgFix  fix 
) [friend]

Returns a pgFix which is the left hand side s32 value multiplied with the right hand side pgFix.

Parameters:
[in] n The left hand side s32 value.
[in] fix The right hand side pgFix.
Returns:
A pgFix which is the left hand side s32 value multiplied with the right hand side pgFix.

PG_API friend pgFix operator+ ( r32  r,
pgFix  fix 
) [friend]

Returns a pgFix which is the sum of the left hand side r32 value and the right hand side pgFix.

Parameters:
[in] r The left hand side r32 value.
[in] fix The right hand side pgFix.
Returns:
a pgFix which is the sum of the left hand side r32 value and the right hand side pgFix.

PG_API friend pgFix operator+ ( s32  n,
pgFix  fix 
) [friend]

Returns a pgFix which is the sum of the left hand side s32 value and the right hand side pgFix.

Parameters:
[in] n The left hand side s32 value.
[in] fix The right hand side pgFix.
Returns:
a pgFix which is the sum of the left hand side s32 value and the right hand side pgFix.

PG_API friend pgFix operator- ( r32  r,
pgFix  fix 
) [friend]

Returns a pgFix which is the right hand side pgFix subtracted from the left hand side r32 value.

Parameters:
[in] r The left hand side r32 value.
[in] fix The right hand side pgFix.
Returns:
A pgFix which is the right hand side pgFix subtracted from the left hand side r32 value.

PG_API friend pgFix operator- ( s32  n,
pgFix  fix 
) [friend]

Returns a pgFix which is the right hand side pgFix subtracted from the left hand side s32 value.

Parameters:
[in] n The left hand side s32 value.
[in] fix The right hand side pgFix.
Returns:
A pgFix which is the right hand side pgFix subtracted from the left hand side s32 value.

PG_API friend pgFix operator/ ( r32  r,
pgFix  fix 
) [friend]

Returns a pgFix which is the left hand side r32 value divided by the right hand side pgFix.

Parameters:
[in] r The left hand side r32 value.
[in] fix The right hand side pgFix.
Returns:
A pgFix which is the left hand side r32 value divided by the right hand side pgFix.

PG_API friend pgFix operator/ ( s32  n,
pgFix  fix 
) [friend]

Returns a pgFix which is the left hand side s32 value divided by the right hand side pgFix.

Parameters:
[in] n The left hand side s32 value.
[in] fix The right hand side pgFix.
Returns:
A pgFix which is the left hand side s32 value devided by the right hand side pgFix.


The documentation for this class was generated from the following file:

Generated on Sat Aug 15 11:24:38 2009 for Pogolyn by  doxygen 1.5.8