m >>= 1;
e++;
}
- while( ((m>>32)&0xfff00000)==0 ){
+ while( m!=0 && ((m>>32)&0xfff00000)==0 ){
m <<= 1;
e--;
}
e += 1075;
if( e<0 ) e = m = 0;
- if( e>0x7ff ) m = 0;
+ if( e>0x7ff ) e = 0x7ff;
a = m & ((((sqlite3_int64)1)<<52)-1);
a |= e<<52;
if( isNeg ) a |= ((sqlite3_int64)1)<<63;
-C Have\sfts5\sload\sits\sconfiguration\sfrom\sthe\sxConnect()\smethod\sis\sinvoked.\sThis\sensures\sthat\sthe\svery\sfirst\squery\srun\suses\sthe\scorrect\svalue\sof\sthe\s'rank'\soption.
-D 2015-11-06T12:50:57.166
+C Test\scases\sfor\sthe\sieee754\sextension.
+D 2015-11-06T17:01:20.579
F Makefile.in 3a705bb4bd12e194212ddbdbf068310d17153cdb
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 702d3e98f3afc6587a78481257f3c4c900efc3a4
F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
F ext/misc/fuzzer.c 4c84635c71c26cfa7c2e5848cf49fe2d2cfcd767
-F ext/misc/ieee754.c b0362167289170627659e84173f5d2e8fee8566e
+F ext/misc/ieee754.c ca4a0a8fd2d4667a7ef10b761312c256bc734039
F ext/misc/json1.c 4f45afd9dbcd6feca8c528251efbb7fc09299a09
F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
F test/hexlit.test 1d312fa816dfd3650a3bb488093bc09a0c927f67
F test/hook.test 162d7cef7a2d2b04839fe14402934e6a1b79442f
F test/icu.test 70df4faca133254c042d02ae342c0a141f2663f4
+F test/ieee754.test 118b665a97a8df0e8f2fbdb07d113e596f4a6b53
F test/imposter1.test c3f1db2d3db2c24611a6596a3fc0ffc14f1466c8
F test/in.test 61a24ae38d4b64ec69f06ccdf022992f68a98176
F test/in2.test 5d4c61d17493c832f7d2d32bef785119e87bde75
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 777ae8007f6ff303b120b25f2dc37d7ef6b6a4f8
-R 4ec8b8e5e66f6ab44c58d4f991232b45
-U dan
-Z f9c34cc6cfcf4374f3d76c696dbe3249
+P 33e6606f5e497e81119ec491cf2370f60bddafc0
+R 6a48cd86f6e2c59a9972f4901e737c7d
+U drh
+Z 4f550f3fed6ca631b416aee9408c87ae
-33e6606f5e497e81119ec491cf2370f60bddafc0
\ No newline at end of file
+840cbda88675b6012dae2423252bf42d0d563874
\ No newline at end of file
--- /dev/null
+# 2015-11-06
+#
+# 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.
+#
+#***********************************************************************
+#
+# Tests of the iee754 extension
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+load_static_extension db ieee754
+
+foreach {id float rep} {
+ 1 1.0 1,0
+ 2 2.0 2,0
+ 3 0.5 1,-1
+ 4 1.5 3,-1
+ 5 0.0 0,-1075
+ 6 4.9406564584124654e-324 4503599627370497,-1075
+ 7 2.2250738585072009e-308 9007199254740991,-1075
+ 8 2.2250738585072014e-308 1,-1022
+} {
+ do_test ieee754-100-$id-1 {
+ db eval "SELECT ieee754($float);"
+ } "ieee754($rep)"
+ do_test ieee754-100-$id-2 {
+ db eval "SELECT ieee754($rep)==$float;"
+ } {1}
+ if {$float!=0.0} {
+ do_test ieee754-100-$id-3 {
+ db eval "SELECT ieee754(-$float);"
+ } "ieee754(-$rep)"
+ do_test ieee754-100-$id-4 {
+ db eval "SELECT ieee754(-$rep)==-$float;"
+ } {1}
+ }
+}
+
+do_execsql_test ieee754-110 {
+ SELECT ieee754(1,1024), ieee754(4503599627370495,972);
+} {Inf 1.79769313486232e+308}
+do_execsql_test ieee754-111 {
+ SELECT ieee754(-1,1024), ieee754(-4503599627370495,972);
+} {-Inf -1.79769313486232e+308}
+do_execsql_test ieee754-112 {
+ SELECT ieee754(4503599627370495,973) is null;
+} {1}
+
+finish_test