The first thing we need to know isCInt Range-32,768 to 32,767.CLng Range-2,147,483,648 to 2,147,483,647.CInt and clng meaning:Can force an expression to be converted to a data typeCInt and clng The scope of processing data:CInt integer-32,768 to 32,767, fractional part rounded.CLng long-2,147,483,648 to 2,147,483,647, fractional part rounded.The so-called overflo
Meaning of cint and clng:
You can forcibly convert an expression to a data type.
Cint and clng:
CInt Integer-32,768 to 32,767, rounded to the decimal part.CLng Long-2,147,483,648 to 2,147,483,647, rounded to the decimal part.
Overflow refers to a code that is out of the scope of data processing. The following code processes data to prevent data overflow. You can check it for yourself:
'Check whether it is a
CLng Function
Return expression, which has been convertedLongChild typeVariant.
CLng(expression)
ExpressionThe parameter is any valid expression.Description
Generally, you can use the subtype Data Conversion Function to write code to show that the results of some operations should be expressed as specific data types rather than the default data types. For example, in the case of currency operations, single-
CInt and clng meaning:
Can force an expression to be converted to a data type
CInt and clng The scope of processing data:
CInt integer-32,768 to 32,767, fractional part rounded.CLng long-2,147,483,648 to 2,147,483,647, fractional part rounded.
The so-called overflow refers to the scope of processing data, the following code is to handle data to prevent overflow code, you can see for yourselves:
' Detec
CLng function
Returns an expression that has been converted to a Variantof a Long subtype.
CLng(expression)
The expression parameter is any valid expression.
Description
Typically, you can use subtype data conversion functions to write code to show that the results of certain operations should be expressed as a specific data type, not as a default data type. For example, in the case of currency operations,
is far lower than that of. net built-in functions.
The following code is provided:
Original ASP encryption code:
Private Const BITS_TO_A_BYTE = 8Private Const BYTES_TO_A_WORD = 4Private Const BITS_TO_A_WORD = 32Private m_lOnBits (30)Private m_l2Power (30)M_lOnBits (0) = CLng (1)M_lOnBits (1) = CLng (3)M_lOnBits (2) = CLng (7)M_lOnBits (3) =
)
Lwordarray (lNumberOfWords-2) = LShift (Lmessagelength, 3)
Lwordarray (lNumberOfWords-1) = Rshift (lmessagelength, 29)
Converttowordarray = Lwordarray
End Function
Private Function Wordtohex (lvalue)
Dim Lbyte
Dim Lcount
For lcount = 0 to 3
Lbyte = Rshift (lvalue, Lcount * bits_to_a_byte) and m_lonbits (bits_to_a_byte-1)
Wordtohex = Wordtohex Right ("0" Hex (Lbyte), 2)
Next
End Function
Public Function MD5 (smessage)
M_lonbits (0) = CLng (1)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.