<%
Private Const BITS_TO_A_BYTE = 8
Private Const BYTES_TO_A_WORD = 4
Private Const BITS_TO_A_WORD = 32
Private m_lOnBits(30)
Private m_l2Power(30)
Private Function LShift(lValue, iShiftBits)
if iShiftBits = 0 Then
LShift = lValue
Exit Function
elseif iShiftBits = 31 Then
if lValue And 1 Then
LShift = &H80000000
else
LShift = 0
End if
Exit Function
elseif iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End if
if (lValue And m_l2Power(31 - iShiftBits)) Then
LShift = ((lValue And m_lOnBits(31 - (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000
else
LShift = ((lValue And m_lOnBits(31 - iShiftBits)) * m_l2Power(iShiftBits))
End if
End Function
Private Function RShift(lValue, iShiftBits)
if iShiftBits = 0 Then
RShift = lValue
Exit Function
elseif iShiftBits = 31 Then
if lValue And &H80000000 Then
RShift = 1
else
RShift = 0
End if
Exit Function
elseif iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End if
RShift = (lValue And &H7FFFFFFE) \ m_l2Power(iShiftBits)
Private Const BITS_TO_A_BYTE = 8
Private Const BYTES_TO_A_WORD = 4
Private Const BITS_TO_A_WORD = 32
Private m_lOnBits(30)
Private m_l2Power(30)
Private Function LShift(lValue, iShiftBits)
if iShiftBits = 0 Then
LShift = lValue
Exit Function
elseif iShiftBits = 31 Then
if lValue And 1 Then
LShift = &H80000000
else
LShift = 0
End if
Exit Function
elseif iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End if
if (lValue And m_l2Power(31 - iShiftBits)) Then
LShift = ((lValue And m_lOnBits(31 - (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000
else
LShift = ((lValue And m_lOnBits(31 - iShiftBits)) * m_l2Power(iShiftBits))
End if
End Function
Private Function RShift(lValue, iShiftBits)
if iShiftBits = 0 Then
RShift = lValue
Exit Function
elseif iShiftBits = 31 Then
if lValue And &H80000000 Then
RShift = 1
else
RShift = 0
End if
Exit Function
elseif iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End if
RShift = (lValue And &H7FFFFFFE) \ m_l2Power(iShiftBits)

