Documentation Source Text

Check-in [f9d830d206]
Login

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

Overview
Comment:Change the documented behavior of casting a large real into an integer.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f9d830d20643f88d5b46cf5a6ba322e0e8e6eb7a
User & Date: drh 2013-11-26 21:07:30.952
Context
2013-11-27
01:26
Add documentation for the SQLITE_WIN32_HEAP compile-time option. Fix typos in the change log. (check-in: 907e8cfb73 user: drh tags: trunk)
2013-11-26
21:07
Change the documented behavior of casting a large real into an integer. (check-in: f9d830d206 user: drh tags: trunk)
17:47
Add the double-to-int casting change to the change log. Set the release date (tenatively) to 2013-12-10. (check-in: 45cab1f685 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to pages/lang.in.
1993
1994
1995
1996
1997
1998
1999
2000
2001

2002

2003
2004
2005
2006
2007
2008
2009
        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.

      <p>^A cast of a REAL value into an INTEGER will truncate the fractional
      part of the REAL.  ^If a REAL is too large to be represented as an 
      INTEGER then the result of the cast is the largest negative integer: 

      -9223372036854775808.


<tr>
  <td> NUMERIC
  <td> ^Casting a TEXT or BLOB value into NUMERIC first does a forced
   conversion into REAL but then further converts the result into INTEGER if
   and only if the conversion from REAL to INTEGER is lossless and reversible.
   This is the only context in SQLite where the NUMERIC and INTEGER [affinities]







|
|
>
|
>







1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
        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.

      <p>^A cast of a REAL value into an INTEGER will truncate the fractional
      part of the REAL.  ^If a REAL is greater than the greatest possible signed
      integer (+9223372036854775807) then the result is the greatest possible
      signed integer and if the REAL is less than the least possible signed
      integer (-9223372036854775808) then the result is the least possible
      signed integer.

<tr>
  <td> NUMERIC
  <td> ^Casting a TEXT or BLOB value into NUMERIC first does a forced
   conversion into REAL but then further converts the result into INTEGER if
   and only if the conversion from REAL to INTEGER is lossless and reversible.
   This is the only context in SQLite where the NUMERIC and INTEGER [affinities]