Marco Rego.pcs.crosspost
Shift for bits August 27, 2008 05:24PM |
BLS.pcs.crosspost
Re: Shift for bits August 27, 2008 05:50PM |
BLS
Re: Shift for bits August 27, 2008 05:52PM |
PROCEDURE ShiftLeft(nInt, nBitsToShift) nResult is int WHEN EXCEPTION ExceptionEnable() RESULT -1 END nResult = nInt * Power(2, nBitsToShift) RESULT nResult FUNCTION ShiftRight(nInt, nBitsToShift) nRetval is int WHEN EXCEPTION // Capacity Error ExceptionEnable() RESULT -1 END nRetval = nInt / Power(2, nBitsToShift) RESULT nRetval