^When casting a TEXT value to INTEGER, the longest possible prefix of the value that can be interpreted as an integer number is extracted from the TEXT value and the remainder ignored. ^Any leading spaces in the TEXT value when converting from TEXT to INTEGER are ignored. ^If there is no prefix that can be interpreted as an integer number, the result - of the conversion is 0. ^(The CAST operator understands decimal + of the conversion is 0. ^If the prefix integer is greater than + +9223372036854775807 then the result of the cast is exactly + +9223372036854775807. ^Similarly, if the prefix integer is + less than -9223372036854775808 then the result of the cast is + exactly -9223372036854775808. + +

^When casting to INTEGER, if the text looks like a floating point + value with an exponent, the exponent will be ignored because it is + no part of the integer prefix. ^For example, + "(CAST '123e+5' AS INTEGER)" results in 123, not in 12300000. + +

^(The CAST operator understands decimal integers only — conversion of [hexadecimal integers] stops at the "x" in the "0x" prefix of the hexadecimal integer string and thus result of the CAST is always zero.)^

^A cast of a REAL value into an INTEGER results in the integer