CULNGINT
- 来源: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgCulngint
- 最后更新: 2016-03-12
将数值或字符串表达式转换为 64 位无符号整数(Ulongint)
语法
vb
declare function Culngint ( byval expression as datatype ) as ulongint
Type typename
declare operator cast ( ) as ulongint
End Type用法
vb
result = Culngint( numeric expression )
result = Culngint( string expression )
result = Culngint( user defined type )参数
expression
要转换为 Ulongint 值的数值、字符串或指针表达式
datatype
任何数值、字符串或指针数据类型
typename
用户自定义类型
返回值
Ulongint 值。
说明
Culngint 函数舍去小数部分并返回 64 位 Ulongint 值。该函数不检查溢出,对于小于 0 或大于 18446744073709551615 的值,结果是未定义的。此外,对于高于 2^63(9223372036854775808)的浮点表达式,当前不保证转换正常工作。
函数名可以理解为"转换为无符号长整型"(Convert to Unsigned LoNG INTeger)。
如果参数是字符串表达式,则使用 Valulng 将其转换为数值。
示例
start GeSHi
vb
' Using the CLNGINT function to convert a numeric value
'Create an UNSIGNED LONG INTEGER variable
Dim numeric_value As ULongInt
'Convert a numeric value
numeric_value = CULngInt(12345678.123)
'Print the result, should return 12345678
Print numeric_value
Sleepend GeSHi
方言差异
- 在 -lang qb 方言中不可用,除非使用别名
__Culngint引用。
与 QB 的差异
- FreeBASIC 新增特性
另请参阅
CbyteCubyteCshortCushortCintCuintClngCulngClngintCsngCdbl
返回 目录