Documentation Source Text

Check-in [6b1b360098]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update documentation for CAST to integer to describe what happens when the integer is too large. This behavior is only supported on the latest trunk, so with this check-in the documentation is no longer suitable for use with 3.22.0.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6b1b36009807785ebea754d70b567a1f58186ed52e9db0c61e6651b00ff75b3d
User & Date: drh 2018-01-26 18:38:34
Context
2018-01-27
20:56
Update zipfile documentation to include using the table-valued function to read an in-memory zip archive. check-in: 5b698017df user: dan tags: trunk
2018-01-26
18:38
Update documentation for CAST to integer to describe what happens when the integer is too large. This behavior is only supported on the latest trunk, so with this check-in the documentation is no longer suitable for use with 3.22.0. check-in: 6b1b360098 user: drh tags: trunk
15:50
Turn on "fancy-format" for the optoverview.html document. check-in: 98e66068fe user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/lang.in.

2305
2306
2307
2308
2309
2310
2311











2312
2313
2314
2315
2316
2317
2318
2319
  <td> ^When casting a BLOB value to INTEGER, the value is first converted to
        TEXT.
       <p>^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
        integers only &mdash; 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.)^

      <p>^A cast of a REAL value into an INTEGER results in the integer
      between the REAL value and zero that is closest to the REAL value.
      ^If a REAL is greater than the greatest possible signed







>
>
>
>
>
>
>
>
>
>
>
|







2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
  <td> ^When casting a BLOB value to INTEGER, the value is first converted to
        TEXT.
       <p>^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.  ^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.

        <p>^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.

        <p> ^(The CAST operator understands decimal
        integers only &mdash; 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.)^

      <p>^A cast of a REAL value into an INTEGER results in the integer
      between the REAL value and zero that is closest to the REAL value.
      ^If a REAL is greater than the greatest possible signed