{{fbdoc item="title" value="CLNGINT"}}---- Converts numeric or string expression to 64-bit integer (##[[KeyPgLongint|Longint]]##) {{fbdoc item="syntax"}}## [[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Clngint** ( [[KeyPgByval|byval]] //expression// [[KeyPgAs|as]] [[DataType|datatype]] ) [[KeyPgAs|as]] [[KeyPgLongint|longint]] [[KeyPgType|Type]] //typename// [[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] [[KeyPgCast|cast]] ( ) [[KeyPgAs|as]] [[KeyPgLongint|longint]] End Type ## {{fbdoc item="usage"}}## //result// = **Clngint**( //numeric expression// ) //result// = **Clngint**( //string expression// ) //result// = **Clngint**( //user defined type// ) ## {{fbdoc item="param"}} ##//expression//## a numeric, string, or pointer expression to cast to a ##[[KeyPgLongint|Longint]]## value ##//datatype//## any numeric, string, or pointer data type ##//typename//## a user defined type {{fbdoc item="ret"}} A ##[[KeyPgLongint|Longint]]## value. {{fbdoc item="desc"}} The ##**Clngint**## function rounds off the decimal part and returns a 64-bit ##[[KeyPgLongint|Longint]]## value. The function does not check for an overflow, and results are undefined for values which are less than ##-9## ##223## ##372## ##036## ##854## ##775## ##808## or larger than ##223## ##372## ##036## ##854## ##775## ##807##. The name can be explained as 'Convert to ""LoNG INTeger""'. If the argument is a string expression, it is converted to numeric by using ##[[KeyPgVallng|Vallng]]##. {{fbdoc item="ex"}} {{fbdoc item="filename" value="examples/manual/casting/clngint.bas"}}%%(freebasic) ' Using the CLNGINT function to convert a numeric value 'Create an LONG INTEGER variable DIM numeric_value AS LONGINT 'Convert a numeric value numeric_value = CLNGINT(-12345678.123) 'Print the result, should return -12345678 PRINT numeric_value SLEEP %% {{fbdoc item="lang"}} - Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__Clngint""**##. {{fbdoc item="diff"}} - New to ""FreeBASIC"" {{fbdoc item="see"}} - ##[[KeyPgCbyte|Cbyte]]## - ##[[KeyPgCubyte|Cubyte]]## - ##[[KeyPgCshort|Cshort]]## - ##[[KeyPgCushort|Cushort]]## - ##[[KeyPgCint|Cint]]## - ##[[KeyPgCuint|Cuint]]## - ##[[KeyPgClng|Clng]]## - ##[[KeyPgCulng|Culng]]## - ##[[KeyPgCulngint|Culngint]]## - ##[[KeyPgCsng|Csng]]## - ##[[KeyPgCdbl|Cdbl]]## {{fbdoc item="back" value="CatPgCasting|Converting Data Types"}}