123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758 |
- # 2013 March 10
- #
- # The author disclaims copyright to this source code. In place of
- # a legal notice, here is a blessing:
- #
- # May you do good and not evil.
- # May you find forgiveness for yourself and forgive others.
- # May you share freely, never taking more than you give.
- #
- #***********************************************************************
- # This file implements regression tests for SQLite library. The focus of
- # this file is testing the tointeger() and toreal() functions.
- #
- # Several of the toreal() tests are disabled on platforms where floating
- # point precision is not high enough to represent their constant integer
- # expression arguments as double precision floating point values.
- #
- set testdir [file dirname $argv0]
- source $testdir/tester.tcl
- set saved_tcl_precision $tcl_precision
- set tcl_precision 0
- load_static_extension db totype
- set highPrecision(1) [expr \
- {[db eval {SELECT tointeger(9223372036854775807 + 1);}] eq {{}}}]
- do_execsql_test func4-1.1 {
- SELECT tointeger(NULL);
- } {{}}
- do_execsql_test func4-1.2 {
- SELECT tointeger('');
- } {{}}
- do_execsql_test func4-1.3 {
- SELECT tointeger(' ');
- } {{}}
- do_execsql_test func4-1.4 {
- SELECT tointeger('1234');
- } {1234}
- do_execsql_test func4-1.5 {
- SELECT tointeger(' 1234');
- } {{}}
- do_execsql_test func4-1.6 {
- SELECT tointeger('bad');
- } {{}}
- do_execsql_test func4-1.7 {
- SELECT tointeger('0xBAD');
- } {{}}
- do_execsql_test func4-1.8 {
- SELECT tointeger('123BAD');
- } {{}}
- do_execsql_test func4-1.9 {
- SELECT tointeger('0x123BAD');
- } {{}}
- do_execsql_test func4-1.10 {
- SELECT tointeger('123NO');
- } {{}}
- do_execsql_test func4-1.11 {
- SELECT tointeger('0x123NO');
- } {{}}
- do_execsql_test func4-1.12 {
- SELECT tointeger('-0x1');
- } {{}}
- do_execsql_test func4-1.13 {
- SELECT tointeger('-0x0');
- } {{}}
- do_execsql_test func4-1.14 {
- SELECT tointeger('0x0');
- } {{}}
- do_execsql_test func4-1.15 {
- SELECT tointeger('0x1');
- } {{}}
- do_execsql_test func4-1.16 {
- SELECT tointeger(-1);
- } {-1}
- do_execsql_test func4-1.17 {
- SELECT tointeger(-0);
- } {0}
- do_execsql_test func4-1.18 {
- SELECT tointeger(0);
- } {0}
- do_execsql_test func4-1.19 {
- SELECT tointeger(1);
- } {1}
- do_execsql_test func4-1.20 {
- SELECT tointeger(-1.79769313486232e308 - 1);
- } {{}}
- do_execsql_test func4-1.21 {
- SELECT tointeger(-1.79769313486232e308);
- } {{}}
- do_execsql_test func4-1.22 {
- SELECT tointeger(-1.79769313486232e308 + 1);
- } {{}}
- do_execsql_test func4-1.23 {
- SELECT tointeger(-9223372036854775808 - 1);
- } {-9223372036854775808}
- do_execsql_test func4-1.24 {
- SELECT tointeger(-9223372036854775808);
- } {-9223372036854775808}
- do_execsql_test func4-1.25 {
- SELECT tointeger(-9223372036854775808 + 1);
- } {-9223372036854775807}
- do_execsql_test func4-1.26 {
- SELECT tointeger(-9223372036854775807 - 1);
- } {-9223372036854775808}
- do_execsql_test func4-1.27 {
- SELECT tointeger(-9223372036854775807);
- } {-9223372036854775807}
- do_execsql_test func4-1.28 {
- SELECT tointeger(-9223372036854775807 + 1);
- } {-9223372036854775806}
- do_execsql_test func4-1.29 {
- SELECT tointeger(-2147483648 - 1);
- } {-2147483649}
- do_execsql_test func4-1.30 {
- SELECT tointeger(-2147483648);
- } {-2147483648}
- do_execsql_test func4-1.31 {
- SELECT tointeger(-2147483648 + 1);
- } {-2147483647}
- do_execsql_test func4-1.32 {
- SELECT tointeger(2147483647 - 1);
- } {2147483646}
- do_execsql_test func4-1.33 {
- SELECT tointeger(2147483647);
- } {2147483647}
- do_execsql_test func4-1.34 {
- SELECT tointeger(2147483647 + 1);
- } {2147483648}
- do_execsql_test func4-1.35 {
- SELECT tointeger(9223372036854775807 - 1);
- } {9223372036854775806}
- do_execsql_test func4-1.36 {
- SELECT tointeger(9223372036854775807);
- } {9223372036854775807}
- if {$highPrecision(1)} {
- do_execsql_test func4-1.37 {
- SELECT tointeger(9223372036854775807 + 1);
- } {{}}
- }
- do_execsql_test func4-1.38 {
- SELECT tointeger(1.79769313486232e308 - 1);
- } {{}}
- do_execsql_test func4-1.39 {
- SELECT tointeger(1.79769313486232e308);
- } {{}}
- do_execsql_test func4-1.40 {
- SELECT tointeger(1.79769313486232e308 + 1);
- } {{}}
- do_execsql_test func4-1.41 {
- SELECT tointeger(4503599627370496 - 1);
- } {4503599627370495}
- do_execsql_test func4-1.42 {
- SELECT tointeger(4503599627370496);
- } {4503599627370496}
- do_execsql_test func4-1.43 {
- SELECT tointeger(4503599627370496 + 1);
- } {4503599627370497}
- do_execsql_test func4-1.44 {
- SELECT tointeger(9007199254740992 - 1);
- } {9007199254740991}
- do_execsql_test func4-1.45 {
- SELECT tointeger(9007199254740992);
- } {9007199254740992}
- do_execsql_test func4-1.46 {
- SELECT tointeger(9007199254740992 + 1);
- } {9007199254740993}
- do_execsql_test func4-1.47 {
- SELECT tointeger(9223372036854775807 - 1);
- } {9223372036854775806}
- do_execsql_test func4-1.48 {
- SELECT tointeger(9223372036854775807);
- } {9223372036854775807}
- if {$highPrecision(1)} {
- do_execsql_test func4-1.49 {
- SELECT tointeger(9223372036854775807 + 1);
- } {{}}
- do_execsql_test func4-1.50 {
- SELECT tointeger(9223372036854775808 - 1);
- } {{}}
- do_execsql_test func4-1.51 {
- SELECT tointeger(9223372036854775808);
- } {{}}
- do_execsql_test func4-1.52 {
- SELECT tointeger(9223372036854775808 + 1);
- } {{}}
- }
- do_execsql_test func4-1.53 {
- SELECT tointeger(18446744073709551616 - 1);
- } {{}}
- do_execsql_test func4-1.54 {
- SELECT tointeger(18446744073709551616);
- } {{}}
- do_execsql_test func4-1.55 {
- SELECT tointeger(18446744073709551616 + 1);
- } {{}}
- ifcapable floatingpoint {
- set highPrecision(2) [expr \
- {[db eval {SELECT toreal(-9223372036854775808 + 1);}] eq {{}}}]
- do_execsql_test func4-2.1 {
- SELECT toreal(NULL);
- } {{}}
- do_execsql_test func4-2.2 {
- SELECT toreal('');
- } {{}}
- do_execsql_test func4-2.3 {
- SELECT toreal(' ');
- } {{}}
- do_execsql_test func4-2.4 {
- SELECT toreal('1234');
- } {1234.0}
- do_execsql_test func4-2.5 {
- SELECT toreal(' 1234');
- } {{}}
- do_execsql_test func4-2.6 {
- SELECT toreal('bad');
- } {{}}
- do_execsql_test func4-2.7 {
- SELECT toreal('0xBAD');
- } {{}}
- do_execsql_test func4-2.8 {
- SELECT toreal('123BAD');
- } {{}}
- do_execsql_test func4-2.9 {
- SELECT toreal('0x123BAD');
- } {{}}
- do_execsql_test func4-2.10 {
- SELECT toreal('123NO');
- } {{}}
- do_execsql_test func4-2.11 {
- SELECT toreal('0x123NO');
- } {{}}
- do_execsql_test func4-2.12 {
- SELECT toreal('-0x1');
- } {{}}
- do_execsql_test func4-2.13 {
- SELECT toreal('-0x0');
- } {{}}
- do_execsql_test func4-2.14 {
- SELECT toreal('0x0');
- } {{}}
- do_execsql_test func4-2.15 {
- SELECT toreal('0x1');
- } {{}}
- do_execsql_test func4-2.16 {
- SELECT toreal(-1);
- } {-1.0}
- do_execsql_test func4-2.17 {
- SELECT toreal(-0);
- } {0.0}
- do_execsql_test func4-2.18 {
- SELECT toreal(0);
- } {0.0}
- do_execsql_test func4-2.19 {
- SELECT toreal(1);
- } {1.0}
- do_execsql_test func4-2.20 {
- SELECT toreal(-1.79769313486232e308 - 1);
- } {-Inf}
- do_execsql_test func4-2.21 {
- SELECT toreal(-1.79769313486232e308);
- } {-Inf}
- do_execsql_test func4-2.22 {
- SELECT toreal(-1.79769313486232e308 + 1);
- } {-Inf}
- do_execsql_test func4-2.23 {
- SELECT toreal(-9223372036854775808 - 1);
- } {-9.223372036854776e+18}
- do_execsql_test func4-2.24 {
- SELECT toreal(-9223372036854775808);
- } {-9.223372036854776e+18}
- if {$highPrecision(2)} {
- do_execsql_test func4-2.25 {
- SELECT toreal(-9223372036854775808 + 1);
- } {{}}
- }
- do_execsql_test func4-2.26 {
- SELECT toreal(-9223372036854775807 - 1);
- } {-9.223372036854776e+18}
- if {$highPrecision(2)} {
- do_execsql_test func4-2.27 {
- SELECT toreal(-9223372036854775807);
- } {{}}
- do_execsql_test func4-2.28 {
- SELECT toreal(-9223372036854775807 + 1);
- } {{}}
- }
- do_execsql_test func4-2.29 {
- SELECT toreal(-2147483648 - 1);
- } {-2147483649.0}
- do_execsql_test func4-2.30 {
- SELECT toreal(-2147483648);
- } {-2147483648.0}
- do_execsql_test func4-2.31 {
- SELECT toreal(-2147483648 + 1);
- } {-2147483647.0}
- do_execsql_test func4-2.32 {
- SELECT toreal(2147483647 - 1);
- } {2147483646.0}
- do_execsql_test func4-2.33 {
- SELECT toreal(2147483647);
- } {2147483647.0}
- do_execsql_test func4-2.34 {
- SELECT toreal(2147483647 + 1);
- } {2147483648.0}
- if {$highPrecision(2)} {
- do_execsql_test func4-2.35 {
- SELECT toreal(9223372036854775807 - 1);
- } {{}}
- if {$highPrecision(1)} {
- do_execsql_test func4-2.36 {
- SELECT toreal(9223372036854775807);
- } {{}}
- }
- }
- do_execsql_test func4-2.37 {
- SELECT toreal(9223372036854775807 + 1);
- } {9.223372036854776e+18}
- do_execsql_test func4-2.38 {
- SELECT toreal(1.79769313486232e308 - 1);
- } {Inf}
- do_execsql_test func4-2.39 {
- SELECT toreal(1.79769313486232e308);
- } {Inf}
- do_execsql_test func4-2.40 {
- SELECT toreal(1.79769313486232e308 + 1);
- } {Inf}
- do_execsql_test func4-2.41 {
- SELECT toreal(4503599627370496 - 1);
- } {4503599627370495.0}
- do_execsql_test func4-2.42 {
- SELECT toreal(4503599627370496);
- } {4503599627370496.0}
- do_execsql_test func4-2.43 {
- SELECT toreal(4503599627370496 + 1);
- } {4503599627370497.0}
- do_execsql_test func4-2.44 {
- SELECT toreal(9007199254740992 - 1);
- } {9007199254740991.0}
- do_execsql_test func4-2.45 {
- SELECT toreal(9007199254740992);
- } {9007199254740992.0}
- if {$highPrecision(2)} {
- do_execsql_test func4-2.46 {
- SELECT toreal(9007199254740992 + 1);
- } {{}}
- }
- do_execsql_test func4-2.47 {
- SELECT toreal(9007199254740992 + 2);
- } {9007199254740994.0}
- do_execsql_test func4-2.48 {
- SELECT toreal(tointeger(9223372036854775808) - 1);
- } {{}}
- if {$highPrecision(1)} {
- do_execsql_test func4-2.49 {
- SELECT toreal(tointeger(9223372036854775808));
- } {{}}
- do_execsql_test func4-2.50 {
- SELECT toreal(tointeger(9223372036854775808) + 1);
- } {{}}
- }
- do_execsql_test func4-2.51 {
- SELECT toreal(tointeger(18446744073709551616) - 1);
- } {{}}
- do_execsql_test func4-2.52 {
- SELECT toreal(tointeger(18446744073709551616));
- } {{}}
- do_execsql_test func4-2.53 {
- SELECT toreal(tointeger(18446744073709551616) + 1);
- } {{}}
- }
- ifcapable check {
- do_execsql_test func4-3.1 {
- CREATE TABLE t1(
- x INTEGER CHECK(tointeger(x) IS NOT NULL)
- );
- } {}
- do_test func4-3.2 {
- catchsql {
- INSERT INTO t1 (x) VALUES (NULL);
- }
- } {1 {constraint failed}}
- do_test func4-3.3 {
- catchsql {
- INSERT INTO t1 (x) VALUES (NULL);
- }
- } {1 {constraint failed}}
- do_test func4-3.4 {
- catchsql {
- INSERT INTO t1 (x) VALUES ('');
- }
- } {1 {constraint failed}}
- do_test func4-3.5 {
- catchsql {
- INSERT INTO t1 (x) VALUES ('bad');
- }
- } {1 {constraint failed}}
- do_test func4-3.6 {
- catchsql {
- INSERT INTO t1 (x) VALUES ('1234bad');
- }
- } {1 {constraint failed}}
- do_test func4-3.7 {
- catchsql {
- INSERT INTO t1 (x) VALUES ('1234.56bad');
- }
- } {1 {constraint failed}}
- do_test func4-3.8 {
- catchsql {
- INSERT INTO t1 (x) VALUES (1234);
- }
- } {0 {}}
- do_test func4-3.9 {
- catchsql {
- INSERT INTO t1 (x) VALUES (1234.56);
- }
- } {1 {constraint failed}}
- do_test func4-3.10 {
- catchsql {
- INSERT INTO t1 (x) VALUES ('1234');
- }
- } {0 {}}
- do_test func4-3.11 {
- catchsql {
- INSERT INTO t1 (x) VALUES ('1234.56');
- }
- } {1 {constraint failed}}
- do_test func4-3.12 {
- catchsql {
- INSERT INTO t1 (x) VALUES (ZEROBLOB(4));
- }
- } {1 {constraint failed}}
- do_test func4-3.13 {
- catchsql {
- INSERT INTO t1 (x) VALUES (X'');
- }
- } {1 {constraint failed}}
- do_test func4-3.14 {
- catchsql {
- INSERT INTO t1 (x) VALUES (X'1234');
- }
- } {1 {constraint failed}}
- do_test func4-3.15 {
- catchsql {
- INSERT INTO t1 (x) VALUES (X'12345678');
- }
- } {1 {constraint failed}}
- do_test func4-3.16 {
- catchsql {
- INSERT INTO t1 (x) VALUES ('1234.00');
- }
- } {1 {constraint failed}}
- do_test func4-3.17 {
- catchsql {
- INSERT INTO t1 (x) VALUES (1234.00);
- }
- } {0 {}}
- do_test func4-3.18 {
- catchsql {
- INSERT INTO t1 (x) VALUES ('-9223372036854775809');
- }
- } {1 {constraint failed}}
- if {$highPrecision(1)} {
- do_test func4-3.19 {
- catchsql {
- INSERT INTO t1 (x) VALUES (9223372036854775808);
- }
- } {1 {constraint failed}}
- }
- do_execsql_test func4-3.20 {
- SELECT x FROM t1 ORDER BY x;
- } {1234 1234 1234}
- ifcapable floatingpoint {
- do_execsql_test func4-4.1 {
- CREATE TABLE t2(
- x REAL CHECK(toreal(x) IS NOT NULL)
- );
- } {}
- do_test func4-4.2 {
- catchsql {
- INSERT INTO t2 (x) VALUES (NULL);
- }
- } {1 {constraint failed}}
- do_test func4-4.3 {
- catchsql {
- INSERT INTO t2 (x) VALUES (NULL);
- }
- } {1 {constraint failed}}
- do_test func4-4.4 {
- catchsql {
- INSERT INTO t2 (x) VALUES ('');
- }
- } {1 {constraint failed}}
- do_test func4-4.5 {
- catchsql {
- INSERT INTO t2 (x) VALUES ('bad');
- }
- } {1 {constraint failed}}
- do_test func4-4.6 {
- catchsql {
- INSERT INTO t2 (x) VALUES ('1234bad');
- }
- } {1 {constraint failed}}
- do_test func4-4.7 {
- catchsql {
- INSERT INTO t2 (x) VALUES ('1234.56bad');
- }
- } {1 {constraint failed}}
- do_test func4-4.8 {
- catchsql {
- INSERT INTO t2 (x) VALUES (1234);
- }
- } {0 {}}
- do_test func4-4.9 {
- catchsql {
- INSERT INTO t2 (x) VALUES (1234.56);
- }
- } {0 {}}
- do_test func4-4.10 {
- catchsql {
- INSERT INTO t2 (x) VALUES ('1234');
- }
- } {0 {}}
- do_test func4-4.11 {
- catchsql {
- INSERT INTO t2 (x) VALUES ('1234.56');
- }
- } {0 {}}
- do_test func4-4.12 {
- catchsql {
- INSERT INTO t2 (x) VALUES (ZEROBLOB(4));
- }
- } {1 {constraint failed}}
- do_test func4-4.13 {
- catchsql {
- INSERT INTO t2 (x) VALUES (X'');
- }
- } {1 {constraint failed}}
- do_test func4-4.14 {
- catchsql {
- INSERT INTO t2 (x) VALUES (X'1234');
- }
- } {1 {constraint failed}}
- do_test func4-4.15 {
- catchsql {
- INSERT INTO t2 (x) VALUES (X'12345678');
- }
- } {1 {constraint failed}}
- do_execsql_test func4-4.16 {
- SELECT x FROM t2 ORDER BY x;
- } {1234.0 1234.0 1234.56 1234.56}
- }
- }
- ifcapable floatingpoint {
- do_execsql_test func4-5.1 {
- SELECT tointeger(toreal('1234'));
- } {1234}
- do_execsql_test func4-5.2 {
- SELECT tointeger(toreal(-1));
- } {-1}
- do_execsql_test func4-5.3 {
- SELECT tointeger(toreal(-0));
- } {0}
- do_execsql_test func4-5.4 {
- SELECT tointeger(toreal(0));
- } {0}
- do_execsql_test func4-5.5 {
- SELECT tointeger(toreal(1));
- } {1}
- do_execsql_test func4-5.6 {
- SELECT tointeger(toreal(-9223372036854775808 - 1));
- } {-9223372036854775808}
- do_execsql_test func4-5.7 {
- SELECT tointeger(toreal(-9223372036854775808));
- } {-9223372036854775808}
- if {$highPrecision(2)} {
- do_execsql_test func4-5.8 {
- SELECT tointeger(toreal(-9223372036854775808 + 1));
- } {{}}
- }
- do_execsql_test func4-5.9 {
- SELECT tointeger(toreal(-2147483648 - 1));
- } {-2147483649}
- do_execsql_test func4-5.10 {
- SELECT tointeger(toreal(-2147483648));
- } {-2147483648}
- do_execsql_test func4-5.11 {
- SELECT tointeger(toreal(-2147483648 + 1));
- } {-2147483647}
- do_execsql_test func4-5.12 {
- SELECT tointeger(toreal(2147483647 - 1));
- } {2147483646}
- do_execsql_test func4-5.13 {
- SELECT tointeger(toreal(2147483647));
- } {2147483647}
- do_execsql_test func4-5.14 {
- SELECT tointeger(toreal(2147483647 + 1));
- } {2147483648}
- do_execsql_test func4-5.15 {
- SELECT tointeger(toreal(9223372036854775807 - 1));
- } {{}}
- if {$highPrecision(1)} {
- do_execsql_test func4-5.16 {
- SELECT tointeger(toreal(9223372036854775807));
- } {{}}
- do_execsql_test func4-5.17 {
- SELECT tointeger(toreal(9223372036854775807 + 1));
- } {{}}
- }
- do_execsql_test func4-5.18 {
- SELECT tointeger(toreal(4503599627370496 - 1));
- } {4503599627370495}
- do_execsql_test func4-5.19 {
- SELECT tointeger(toreal(4503599627370496));
- } {4503599627370496}
- do_execsql_test func4-5.20 {
- SELECT tointeger(toreal(4503599627370496 + 1));
- } {4503599627370497}
- do_execsql_test func4-5.21 {
- SELECT tointeger(toreal(9007199254740992 - 1));
- } {9007199254740991}
- do_execsql_test func4-5.22 {
- SELECT tointeger(toreal(9007199254740992));
- } {9007199254740992}
- if {$highPrecision(2)} {
- do_execsql_test func4-5.23 {
- SELECT tointeger(toreal(9007199254740992 + 1));
- } {{}}
- }
- do_execsql_test func4-5.24 {
- SELECT tointeger(toreal(9007199254740992 + 2));
- } {9007199254740994}
- if {$highPrecision(1)} {
- do_execsql_test func4-5.25 {
- SELECT tointeger(toreal(9223372036854775808 - 1));
- } {{}}
- do_execsql_test func4-5.26 {
- SELECT tointeger(toreal(9223372036854775808));
- } {{}}
- do_execsql_test func4-5.27 {
- SELECT tointeger(toreal(9223372036854775808 + 1));
- } {{}}
- }
- do_execsql_test func4-5.28 {
- SELECT tointeger(toreal(18446744073709551616 - 1));
- } {{}}
- do_execsql_test func4-5.29 {
- SELECT tointeger(toreal(18446744073709551616));
- } {{}}
- do_execsql_test func4-5.30 {
- SELECT tointeger(toreal(18446744073709551616 + 1));
- } {{}}
- }
- for {set i 0} {$i < 10} {incr i} {
- if {$i == 8} continue
- do_execsql_test func4-6.1.$i.1 [subst {
- SELECT tointeger(x'[string repeat 01 $i]');
- }] {{}}
- ifcapable floatingpoint {
- do_execsql_test func4-6.1.$i.2 [subst {
- SELECT toreal(x'[string repeat 01 $i]');
- }] {{}}
- }
- }
- do_execsql_test func4-6.2.1 {
- SELECT tointeger(x'0102030405060708');
- } {578437695752307201}
- do_execsql_test func4-6.2.2 {
- SELECT tointeger(x'0807060504030201');
- } {72623859790382856}
- ifcapable floatingpoint {
- do_execsql_test func4-6.3.1 {
- SELECT toreal(x'ffefffffffffffff');
- } {-1.7976931348623157e+308}
- do_execsql_test func4-6.3.2 {
- SELECT toreal(x'8010000000000000');
- } {-2.2250738585072014e-308}
- do_execsql_test func4-6.3.3 {
- SELECT toreal(x'c000000000000000');
- } {-2.0}
- do_execsql_test func4-6.3.4 {
- SELECT toreal(x'bff0000000000000');
- } {-1.0}
- do_execsql_test func4-6.3.5 {
- SELECT toreal(x'8000000000000000');
- } {-0.0}
- do_execsql_test func4-6.3.6 {
- SELECT toreal(x'0000000000000000');
- } {0.0}
- do_execsql_test func4-6.3.7 {
- SELECT toreal(x'3ff0000000000000');
- } {1.0}
- do_execsql_test func4-6.3.8 {
- SELECT toreal(x'4000000000000000');
- } {2.0}
- do_execsql_test func4-6.3.9 {
- SELECT toreal(x'0010000000000000');
- } {2.2250738585072014e-308}
- do_execsql_test func4-6.3.10 {
- SELECT toreal(x'7fefffffffffffff');
- } {1.7976931348623157e+308}
- do_execsql_test func4-6.3.11 {
- SELECT toreal(x'8000000000000001');
- } {-5e-324}
- do_execsql_test func4-6.3.12 {
- SELECT toreal(x'800fffffffffffff');
- } {-2.225073858507201e-308}
- do_execsql_test func4-6.3.13 {
- SELECT toreal(x'0000000000000001');
- } {5e-324}
- do_execsql_test func4-6.3.14 {
- SELECT toreal(x'000fffffffffffff');
- } {2.225073858507201e-308}
- do_execsql_test func4-6.3.15 {
- SELECT toreal(x'fff0000000000000');
- } {-Inf}
- do_execsql_test func4-6.3.16 {
- SELECT toreal(x'7ff0000000000000');
- } {Inf}
- do_execsql_test func4-6.3.17 {
- SELECT toreal(x'fff8000000000000');
- } {{}}
- do_execsql_test func4-6.3.18 {
- SELECT toreal(x'fff0000000000001');
- } {{}}
- do_execsql_test func4-6.3.19 {
- SELECT toreal(x'fff7ffffffffffff');
- } {{}}
- do_execsql_test func4-6.3.20 {
- SELECT toreal(x'7ff0000000000001');
- } {{}}
- do_execsql_test func4-6.3.21 {
- SELECT toreal(x'7ff7ffffffffffff');
- } {{}}
- do_execsql_test func4-6.3.22 {
- SELECT toreal(x'fff8000000000001');
- } {{}}
- do_execsql_test func4-6.3.23 {
- SELECT toreal(x'ffffffffffffffff');
- } {{}}
- do_execsql_test func4-6.3.24 {
- SELECT toreal(x'7ff8000000000000');
- } {{}}
- do_execsql_test func4-6.3.25 {
- SELECT toreal(x'7fffffffffffffff');
- } {{}}
- }
- set tcl_precision $saved_tcl_precision
- unset saved_tcl_precision
- finish_test
|