ShiftLeft – Shift a Long to the left

ShiftLeft – Shift a Long to the left

' Shift to the left of the specified number of times'' NOTE: requires Power2()Function ShiftLeft(ByVal value As Long, ByVal times As Long) As Long    ' we need to create a mask of 1's corresponding to the    ' times in VALUE that will be retained in the result    Dim mask As Long, signBit As Long        ' return zero if too many times    If times >= 32 Then Exit Function    ' return the value if zero times    If times = 0 Then ShiftLeft = value: Exit Function        ' this extracts the bit in Value that will become the sign bit    mask = Power2(31 - times)    ' this calculates the sign bit of the result    signBit = CBool(value And mask) And &H80000000    ' this clears all the most significant times,    ' that would be lost anyway, and also clears the sign bit    value = value And (mask - 1)    ' do the shift to the left, without risking an overflow    ' and then add the sign bit    ShiftLeft = (value * Power2(times)) Or signBitEnd Function

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of