ccmaths.cpp File Reference

(r1785/r1282)

#include "camtypes.h"

Go to the source code of this file.

Functions

 DECLARE_SOURCE ("$Revision: 1282 $")
XLONG Mul (const INT32 operand1, const INT32 operand2)
 Multiplication of two 32-bit signed numbers (xlongs).
XLONG Asl (const INT32 value, UINT32 shift)
 Performs arithmetic shift left.
XLONG Asr (const INT32 value, UINT32 shift)
 Performs arithmetic shift right.
INT32 MulDiv32By32 (const INT32 operand1, const INT32 operand2, const INT32 operand3)
 Multiplies two 32-bit values and divides the result by another 32-bit value.
XLONG MakeXLong (const INT32 operand)
 To convert an INT32 value to an xlong.
XLONG MakeXLong (const double operand)
 To convert a double value to an xlong.


Function Documentation

XLONG Asl const INT32  value,
UINT32  shift
 

Performs arithmetic shift left.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/5/93
Parameters:
INT32 - value to be shifted [INPUTS] UINT32 - shift count
None [OUTPUTS]
Returns:
XLONG - shifted number.

Errors: None.

Definition at line 158 of file ccmaths.cpp.

00159 {   
00160     XLONG result;
00161     
00162     result = MakeXLong(value);
00163     
00164     return  (result << shift);
00165 
00166 }

XLONG Asr const INT32  value,
UINT32  shift
 

Performs arithmetic shift right.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/5/93
Parameters:
INT32 - value to be shifted [INPUTS] UINT32 - shift count
None [OUTPUTS]
Returns:
XLONG - shifted number.

Errors: None.

Definition at line 189 of file ccmaths.cpp.

00190 {   
00191     return ( XLONG(value) >> shift);
00192 }

DECLARE_SOURCE "$Revision: 1282 $"   ) 
 

XLONG MakeXLong const double  operand  ) 
 

To convert a double value to an xlong.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/5/93
See also:
Xlongasm.h
Parameters:
double value to be converted. [INPUTS]
None. [OUTPUTS]
Returns:
an xlong value.

Errors: None.

Definition at line 263 of file ccmaths.cpp.

00264 {
00265     xlong result;
00266 
00267     DoubleToXlong(operand, result);
00268 
00269     return result;
00270 }

XLONG MakeXLong const INT32  operand  ) 
 

To convert an INT32 value to an xlong.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/5/93
See also:
Xlongasm.h
Parameters:
Long value to be converted. [INPUTS]
None. [OUTPUTS]
Returns:
an xlong value.

Errors: None.

Definition at line 239 of file ccmaths.cpp.

00240 {
00241     return XLONG(operand);
00242 }

XLONG Mul const INT32  operand1,
const INT32  operand2
 

Multiplication of two 32-bit signed numbers (xlongs).

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/93
Parameters:
Two INT32 values [INPUTS]
See also:
Xlongasm.h
Parameters:
None [OUTPUTS]
Returns:
A reference to an xlong with result of multiplication.

Errors: None.

Definition at line 128 of file ccmaths.cpp.

00129 {
00130     XLONG result;
00131 
00132     XMul32(operand1, operand2, result);
00133 
00134     return result;
00135 }

INT32 MulDiv32By32 const INT32  operand1,
const INT32  operand2,
const INT32  operand3
 

Multiplies two 32-bit values and divides the result by another 32-bit value.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/5/93
See also:
Xlongasm.h
Parameters:
operand1 - multiplicand 1 [INPUTS] operand2 - multiplicand 2 operand3 - divisor
None [OUTPUTS]
Returns:
INT32 - result of multiply-divide.

Errors: None.

Definition at line 215 of file ccmaths.cpp.

00216 {
00217     return Mul32Div32( operand1, operand2, operand3 );
00218 }


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