OLD | NEW |
1 # 2001 September 15 | 1 # 2001 September 15 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 14 matching lines...) Expand all Loading... |
25 ifcapable !floatingpoint { | 25 ifcapable !floatingpoint { |
26 execsql {CREATE TABLE test1(i1 int, i2 int, t1 text, t2 text)} | 26 execsql {CREATE TABLE test1(i1 int, i2 int, t1 text, t2 text)} |
27 execsql {INSERT INTO test1 VALUES(1,2,'hello','world')} | 27 execsql {INSERT INTO test1 VALUES(1,2,'hello','world')} |
28 } | 28 } |
29 | 29 |
30 proc test_expr {name settings expr result} { | 30 proc test_expr {name settings expr result} { |
31 do_test $name [format { | 31 do_test $name [format { |
32 execsql {BEGIN; UPDATE test1 SET %s; SELECT %s FROM test1; ROLLBACK;} | 32 execsql {BEGIN; UPDATE test1 SET %s; SELECT %s FROM test1; ROLLBACK;} |
33 } $settings $expr] $result | 33 } $settings $expr] $result |
34 } | 34 } |
| 35 proc test_realnum_expr {name settings expr result} { |
| 36 do_realnum_test $name [format { |
| 37 execsql {BEGIN; UPDATE test1 SET %s; SELECT %s FROM test1; ROLLBACK;} |
| 38 } $settings $expr] $result |
| 39 } |
35 | 40 |
36 test_expr expr-1.1 {i1=10, i2=20} {i1+i2} 30 | 41 test_expr expr-1.1 {i1=10, i2=20} {i1+i2} 30 |
37 test_expr expr-1.2 {i1=10, i2=20} {i1-i2} -10 | 42 test_expr expr-1.2 {i1=10, i2=20} {i1-i2} -10 |
38 test_expr expr-1.3 {i1=10, i2=20} {i1*i2} 200 | 43 test_expr expr-1.3 {i1=10, i2=20} {i1*i2} 200 |
39 test_expr expr-1.4 {i1=10, i2=20} {i1/i2} 0 | 44 test_expr expr-1.4 {i1=10, i2=20} {i1/i2} 0 |
40 test_expr expr-1.5 {i1=10, i2=20} {i2/i1} 2 | 45 test_expr expr-1.5 {i1=10, i2=20} {i2/i1} 2 |
41 test_expr expr-1.6 {i1=10, i2=20} {i2<i1} 0 | 46 test_expr expr-1.6 {i1=10, i2=20} {i2<i1} 0 |
42 test_expr expr-1.7 {i1=10, i2=20} {i2<=i1} 0 | 47 test_expr expr-1.7 {i1=10, i2=20} {i2<=i1} 0 |
43 test_expr expr-1.8 {i1=10, i2=20} {i2>i1} 1 | 48 test_expr expr-1.8 {i1=10, i2=20} {i2>i1} 1 |
44 test_expr expr-1.9 {i1=10, i2=20} {i2>=i1} 1 | 49 test_expr expr-1.9 {i1=10, i2=20} {i2>=i1} 1 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 test_expr expr-1.102 {i1=40, i2=1} {i2<<i1} 1099511627776 | 162 test_expr expr-1.102 {i1=40, i2=1} {i2<<i1} 1099511627776 |
158 } | 163 } |
159 | 164 |
160 ifcapable floatingpoint { | 165 ifcapable floatingpoint { |
161 test_expr expr-1.103 {i1=0} {(-2147483648.0 % -1)} 0.0 | 166 test_expr expr-1.103 {i1=0} {(-2147483648.0 % -1)} 0.0 |
162 test_expr expr-1.104 {i1=0} {(-9223372036854775808.0 % -1)} 0.0 | 167 test_expr expr-1.104 {i1=0} {(-9223372036854775808.0 % -1)} 0.0 |
163 test_expr expr-1.105 {i1=0} {(-9223372036854775808.0 / -1)>1} 1 | 168 test_expr expr-1.105 {i1=0} {(-9223372036854775808.0 / -1)>1} 1 |
164 } | 169 } |
165 | 170 |
166 if {[working_64bit_int]} { | 171 if {[working_64bit_int]} { |
167 test_expr expr-1.106 {i1=0} {-9223372036854775808/-1} 9.22337203685478e+18 | 172 test_realnum_expr expr-1.106 {i1=0} {-9223372036854775808/-1} 9.22337203685478
e+18 |
168 } | 173 } |
169 | 174 |
170 test_expr expr-1.107 {i1=0} {-9223372036854775808%-1} 0 | 175 test_expr expr-1.107 {i1=0} {-9223372036854775808%-1} 0 |
171 test_expr expr-1.108 {i1=0} {1%0} {{}} | 176 test_expr expr-1.108 {i1=0} {1%0} {{}} |
172 test_expr expr-1.109 {i1=0} {1/0} {{}} | 177 test_expr expr-1.109 {i1=0} {1/0} {{}} |
173 | 178 |
174 if {[working_64bit_int]} { | 179 if {[working_64bit_int]} { |
175 test_expr expr-1.110 {i1=0} {-9223372036854775807/-1} 9223372036854775807 | 180 test_expr expr-1.110 {i1=0} {-9223372036854775807/-1} 9223372036854775807 |
176 } | 181 } |
177 | 182 |
(...skipping 15 matching lines...) Expand all Loading... |
193 test_expr expr-1.122 {i1=6, i2=6} {i1 IS NOT i2} 0 | 198 test_expr expr-1.122 {i1=6, i2=6} {i1 IS NOT i2} 0 |
194 test_expr expr-1.123 {i1=NULL, i2=8} \ | 199 test_expr expr-1.123 {i1=NULL, i2=8} \ |
195 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} yes | 200 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} yes |
196 test_expr expr-1.124 {i1=NULL, i2=NULL} \ | 201 test_expr expr-1.124 {i1=NULL, i2=NULL} \ |
197 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} no | 202 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} no |
198 test_expr expr-1.125 {i1=6, i2=NULL} \ | 203 test_expr expr-1.125 {i1=6, i2=NULL} \ |
199 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} yes | 204 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} yes |
200 test_expr expr-1.126 {i1=8, i2=8} \ | 205 test_expr expr-1.126 {i1=8, i2=8} \ |
201 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} no | 206 {CASE WHEN i1 IS NOT i2 THEN 'yes' ELSE 'no' END} no |
202 | 207 |
| 208 do_catchsql_test expr-1.127 { |
| 209 SELECT 1 IS #1; |
| 210 } {1 {near "#1": syntax error}} |
| 211 |
203 ifcapable floatingpoint {if {[working_64bit_int]} { | 212 ifcapable floatingpoint {if {[working_64bit_int]} { |
204 test_expr expr-1.200\ | 213 test_expr expr-1.200\ |
205 {i1=9223372036854775806, i2=1} {i1+i2} 9223372036854775807 | 214 {i1=9223372036854775806, i2=1} {i1+i2} 9223372036854775807 |
206 test_expr expr-1.201\ | 215 test_realnum_expr expr-1.201\ |
207 {i1=9223372036854775806, i2=2} {i1+i2} 9.22337203685478e+18 | 216 {i1=9223372036854775806, i2=2} {i1+i2} 9.22337203685478e+18 |
208 test_expr expr-1.202\ | 217 test_realnum_expr expr-1.202\ |
209 {i1=9223372036854775806, i2=100000} {i1+i2} 9.22337203685488e+18 | 218 {i1=9223372036854775806, i2=100000} {i1+i2} 9.22337203685488e+18 |
210 test_expr expr-1.203\ | 219 test_realnum_expr expr-1.203\ |
211 {i1=9223372036854775807, i2=0} {i1+i2} 9223372036854775807 | 220 {i1=9223372036854775807, i2=0} {i1+i2} 9223372036854775807 |
212 test_expr expr-1.204\ | 221 test_realnum_expr expr-1.204\ |
213 {i1=9223372036854775807, i2=1} {i1+i2} 9.22337203685478e+18 | 222 {i1=9223372036854775807, i2=1} {i1+i2} 9.22337203685478e+18 |
214 test_expr expr-1.205\ | 223 test_realnum_expr expr-1.205\ |
215 {i2=9223372036854775806, i1=1} {i1+i2} 9223372036854775807 | 224 {i2=9223372036854775806, i1=1} {i1+i2} 9223372036854775807 |
216 test_expr expr-1.206\ | 225 test_realnum_expr expr-1.206\ |
217 {i2=9223372036854775806, i1=2} {i1+i2} 9.22337203685478e+18 | 226 {i2=9223372036854775806, i1=2} {i1+i2} 9.22337203685478e+18 |
218 test_expr expr-1.207\ | 227 test_realnum_expr expr-1.207\ |
219 {i2=9223372036854775806, i1=100000} {i1+i2} 9.22337203685488e+18 | 228 {i2=9223372036854775806, i1=100000} {i1+i2} 9.22337203685488e+18 |
220 test_expr expr-1.208\ | 229 test_realnum_expr expr-1.208\ |
221 {i2=9223372036854775807, i1=0} {i1+i2} 9223372036854775807 | 230 {i2=9223372036854775807, i1=0} {i1+i2} 9223372036854775807 |
222 test_expr expr-1.209\ | 231 test_realnum_expr expr-1.209\ |
223 {i2=9223372036854775807, i1=1} {i1+i2} 9.22337203685478e+18 | 232 {i2=9223372036854775807, i1=1} {i1+i2} 9.22337203685478e+18 |
224 test_expr expr-1.210\ | 233 test_realnum_expr expr-1.210\ |
225 {i1=-9223372036854775807, i2=-1} {i1+i2} -9223372036854775808 | 234 {i1=-9223372036854775807, i2=-1} {i1+i2} -9223372036854775808 |
226 test_expr expr-1.211\ | 235 test_realnum_expr expr-1.211\ |
227 {i1=-9223372036854775807, i2=-2} {i1+i2} -9.22337203685478e+18 | 236 {i1=-9223372036854775807, i2=-2} {i1+i2} -9.22337203685478e+18 |
228 test_expr expr-1.212\ | 237 test_realnum_expr expr-1.212\ |
229 {i1=-9223372036854775807, i2=-100000} {i1+i2} -9.22337203685488e+18 | 238 {i1=-9223372036854775807, i2=-100000} {i1+i2} -9.22337203685488e+18 |
230 test_expr expr-1.213\ | 239 test_realnum_expr expr-1.213\ |
231 {i1=-9223372036854775808, i2=0} {i1+i2} -9223372036854775808 | 240 {i1=-9223372036854775808, i2=0} {i1+i2} -9223372036854775808 |
232 test_expr expr-1.214\ | 241 test_realnum_expr expr-1.214\ |
233 {i1=-9223372036854775808, i2=-1} {i1+i2} -9.22337203685478e+18 | 242 {i1=-9223372036854775808, i2=-1} {i1+i2} -9.22337203685478e+18 |
234 test_expr expr-1.215\ | 243 test_realnum_expr expr-1.215\ |
235 {i2=-9223372036854775807, i1=-1} {i1+i2} -9223372036854775808 | 244 {i2=-9223372036854775807, i1=-1} {i1+i2} -9223372036854775808 |
236 test_expr expr-1.216\ | 245 test_realnum_expr expr-1.216\ |
237 {i2=-9223372036854775807, i1=-2} {i1+i2} -9.22337203685478e+18 | 246 {i2=-9223372036854775807, i1=-2} {i1+i2} -9.22337203685478e+18 |
238 test_expr expr-1.217\ | 247 test_realnum_expr expr-1.217\ |
239 {i2=-9223372036854775807, i1=-100000} {i1+i2} -9.22337203685488e+18 | 248 {i2=-9223372036854775807, i1=-100000} {i1+i2} -9.22337203685488e+18 |
240 test_expr expr-1.218\ | 249 test_realnum_expr expr-1.218\ |
241 {i2=-9223372036854775808, i1=0} {i1+i2} -9223372036854775808 | 250 {i2=-9223372036854775808, i1=0} {i1+i2} -9223372036854775808 |
242 test_expr expr-1.219\ | 251 test_realnum_expr expr-1.219\ |
243 {i2=-9223372036854775808, i1=-1} {i1+i2} -9.22337203685478e+18 | 252 {i2=-9223372036854775808, i1=-1} {i1+i2} -9.22337203685478e+18 |
244 test_expr expr-1.220\ | 253 test_realnum_expr expr-1.220\ |
245 {i1=9223372036854775806, i2=-1} {i1-i2} 9223372036854775807 | 254 {i1=9223372036854775806, i2=-1} {i1-i2} 9223372036854775807 |
246 test_expr expr-1.221\ | 255 test_realnum_expr expr-1.221\ |
247 {i1=9223372036854775806, i2=-2} {i1-i2} 9.22337203685478e+18 | 256 {i1=9223372036854775806, i2=-2} {i1-i2} 9.22337203685478e+18 |
248 test_expr expr-1.222\ | 257 test_realnum_expr expr-1.222\ |
249 {i1=9223372036854775806, i2=-100000} {i1-i2} 9.22337203685488e+18 | 258 {i1=9223372036854775806, i2=-100000} {i1-i2} 9.22337203685488e+18 |
250 test_expr expr-1.223\ | 259 test_realnum_expr expr-1.223\ |
251 {i1=9223372036854775807, i2=0} {i1-i2} 9223372036854775807 | 260 {i1=9223372036854775807, i2=0} {i1-i2} 9223372036854775807 |
252 test_expr expr-1.224\ | 261 test_realnum_expr expr-1.224\ |
253 {i1=9223372036854775807, i2=-1} {i1-i2} 9.22337203685478e+18 | 262 {i1=9223372036854775807, i2=-1} {i1-i2} 9.22337203685478e+18 |
254 test_expr expr-1.225\ | 263 test_realnum_expr expr-1.225\ |
255 {i2=-9223372036854775806, i1=1} {i1-i2} 9223372036854775807 | 264 {i2=-9223372036854775806, i1=1} {i1-i2} 9223372036854775807 |
256 test_expr expr-1.226\ | 265 test_realnum_expr expr-1.226\ |
257 {i2=-9223372036854775806, i1=2} {i1-i2} 9.22337203685478e+18 | 266 {i2=-9223372036854775806, i1=2} {i1-i2} 9.22337203685478e+18 |
258 test_expr expr-1.227\ | 267 test_realnum_expr expr-1.227\ |
259 {i2=-9223372036854775806, i1=100000} {i1-i2} 9.22337203685488e+18 | 268 {i2=-9223372036854775806, i1=100000} {i1-i2} 9.22337203685488e+18 |
260 test_expr expr-1.228\ | 269 test_realnum_expr expr-1.228\ |
261 {i2=-9223372036854775807, i1=0} {i1-i2} 9223372036854775807 | 270 {i2=-9223372036854775807, i1=0} {i1-i2} 9223372036854775807 |
262 test_expr expr-1.229\ | 271 test_realnum_expr expr-1.229\ |
263 {i2=-9223372036854775807, i1=1} {i1-i2} 9.22337203685478e+18 | 272 {i2=-9223372036854775807, i1=1} {i1-i2} 9.22337203685478e+18 |
264 test_expr expr-1.230\ | 273 test_realnum_expr expr-1.230\ |
265 {i1=-9223372036854775807, i2=1} {i1-i2} -9223372036854775808 | 274 {i1=-9223372036854775807, i2=1} {i1-i2} -9223372036854775808 |
266 test_expr expr-1.231\ | 275 test_realnum_expr expr-1.231\ |
267 {i1=-9223372036854775807, i2=2} {i1-i2} -9.22337203685478e+18 | 276 {i1=-9223372036854775807, i2=2} {i1-i2} -9.22337203685478e+18 |
268 test_expr expr-1.232\ | 277 test_realnum_expr expr-1.232\ |
269 {i1=-9223372036854775807, i2=100000} {i1-i2} -9.22337203685488e+18 | 278 {i1=-9223372036854775807, i2=100000} {i1-i2} -9.22337203685488e+18 |
270 test_expr expr-1.233\ | 279 test_realnum_expr expr-1.233\ |
271 {i1=-9223372036854775808, i2=0} {i1-i2} -9223372036854775808 | 280 {i1=-9223372036854775808, i2=0} {i1-i2} -9223372036854775808 |
272 test_expr expr-1.234\ | 281 test_realnum_expr expr-1.234\ |
273 {i1=-9223372036854775808, i2=1} {i1-i2} -9.22337203685478e+18 | 282 {i1=-9223372036854775808, i2=1} {i1-i2} -9.22337203685478e+18 |
274 test_expr expr-1.235\ | 283 test_realnum_expr expr-1.235\ |
275 {i2=9223372036854775807, i1=-1} {i1-i2} -9223372036854775808 | 284 {i2=9223372036854775807, i1=-1} {i1-i2} -9223372036854775808 |
276 test_expr expr-1.236\ | 285 test_realnum_expr expr-1.236\ |
277 {i2=9223372036854775807, i1=-2} {i1-i2} -9.22337203685478e+18 | 286 {i2=9223372036854775807, i1=-2} {i1-i2} -9.22337203685478e+18 |
278 test_expr expr-1.237\ | 287 test_realnum_expr expr-1.237\ |
279 {i2=9223372036854775807, i1=-100000} {i1-i2} -9.22337203685488e+18 | 288 {i2=9223372036854775807, i1=-100000} {i1-i2} -9.22337203685488e+18 |
280 test_expr expr-1.238\ | 289 test_realnum_expr expr-1.238\ |
281 {i2=9223372036854775807, i1=0} {i1-i2} -9223372036854775807 | 290 {i2=9223372036854775807, i1=0} {i1-i2} -9223372036854775807 |
282 test_expr expr-1.239\ | 291 test_realnum_expr expr-1.239\ |
283 {i2=9223372036854775807, i1=-1} {i1-i2} -9223372036854775808 | 292 {i2=9223372036854775807, i1=-1} {i1-i2} -9223372036854775808 |
284 | 293 |
285 test_expr expr-1.250\ | 294 test_realnum_expr expr-1.250\ |
286 {i1=4294967296, i2=2147483648} {i1*i2} 9.22337203685478e+18 | 295 {i1=4294967296, i2=2147483648} {i1*i2} 9.22337203685478e+18 |
287 test_expr expr-1.251\ | 296 test_realnum_expr expr-1.251\ |
288 {i1=4294967296, i2=2147483647} {i1*i2} 9223372032559808512 | 297 {i1=4294967296, i2=2147483647} {i1*i2} 9223372032559808512 |
289 test_expr expr-1.252\ | 298 test_realnum_expr expr-1.252\ |
290 {i1=-4294967296, i2=2147483648} {i1*i2} -9223372036854775808 | 299 {i1=-4294967296, i2=2147483648} {i1*i2} -9223372036854775808 |
291 test_expr expr-1.253\ | 300 test_realnum_expr expr-1.253\ |
292 {i1=-4294967296, i2=2147483647} {i1*i2} -9223372032559808512 | 301 {i1=-4294967296, i2=2147483647} {i1*i2} -9223372032559808512 |
293 test_expr expr-1.254\ | 302 test_realnum_expr expr-1.254\ |
294 {i1=4294967296, i2=-2147483648} {i1*i2} -9223372036854775808 | 303 {i1=4294967296, i2=-2147483648} {i1*i2} -9223372036854775808 |
295 test_expr expr-1.255\ | 304 test_realnum_expr expr-1.255\ |
296 {i1=4294967296, i2=-2147483647} {i1*i2} -9223372032559808512 | 305 {i1=4294967296, i2=-2147483647} {i1*i2} -9223372032559808512 |
297 test_expr expr-1.256\ | 306 test_realnum_expr expr-1.256\ |
298 {i1=-4294967296, i2=-2147483648} {i1*i2} 9.22337203685478e+18 | 307 {i1=-4294967296, i2=-2147483648} {i1*i2} 9.22337203685478e+18 |
299 test_expr expr-1.257\ | 308 test_realnum_expr expr-1.257\ |
300 {i1=-4294967296, i2=-2147483647} {i1*i2} 9223372032559808512 | 309 {i1=-4294967296, i2=-2147483647} {i1*i2} 9223372032559808512 |
301 | 310 |
302 }} | 311 }} |
303 | 312 |
304 ifcapable floatingpoint { | 313 ifcapable floatingpoint { |
305 test_expr expr-2.1 {r1=1.23, r2=2.34} {r1+r2} 3.57 | 314 test_expr expr-2.1 {r1=1.23, r2=2.34} {r1+r2} 3.57 |
306 test_expr expr-2.2 {r1=1.23, r2=2.34} {r1-r2} -1.11 | 315 test_expr expr-2.2 {r1=1.23, r2=2.34} {r1-r2} -1.11 |
307 test_expr expr-2.3 {r1=1.23, r2=2.34} {r1*r2} 2.8782 | 316 test_expr expr-2.3 {r1=1.23, r2=2.34} {r1*r2} 2.8782 |
308 } | 317 } |
309 set tcl_precision 15 | 318 set tcl_precision 15 |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 SELECT (CASE a>4 THEN 1 ELSE 0 END) FROM test1; | 885 SELECT (CASE a>4 THEN 1 ELSE 0 END) FROM test1; |
877 } | 886 } |
878 } {1 {near "THEN": syntax error}} | 887 } {1 {near "THEN": syntax error}} |
879 do_test expr-12.2 { | 888 do_test expr-12.2 { |
880 catchsql { | 889 catchsql { |
881 SELECT (CASE WHEN a>4 THEN 1 ELSE 0) FROM test1; | 890 SELECT (CASE WHEN a>4 THEN 1 ELSE 0) FROM test1; |
882 } | 891 } |
883 } {1 {near ")": syntax error}} | 892 } {1 {near ")": syntax error}} |
884 | 893 |
885 ifcapable floatingpoint { | 894 ifcapable floatingpoint { |
886 do_test expr-13.1 { | 895 do_realnum_test expr-13.1 { |
887 execsql { | 896 execsql { |
888 SELECT 12345678901234567890; | 897 SELECT 12345678901234567890; |
889 } | 898 } |
890 } {1.23456789012346e+19} | 899 } {1.23456789012346e+19} |
891 } | 900 } |
892 | 901 |
893 # Implicit String->Integer conversion is used when possible. | 902 # Implicit String->Integer conversion is used when possible. |
894 # | 903 # |
895 if {[working_64bit_int]} { | 904 if {[working_64bit_int]} { |
896 do_test expr-13.2 { | 905 do_test expr-13.2 { |
897 execsql { | 906 execsql { |
898 SELECT 0+'9223372036854775807' | 907 SELECT 0+'9223372036854775807' |
899 } | 908 } |
900 } {9223372036854775807} | 909 } {9223372036854775807} |
901 do_test expr-13.3 { | 910 do_test expr-13.3 { |
902 execsql { | 911 execsql { |
903 SELECT '9223372036854775807'+0 | 912 SELECT '9223372036854775807'+0 |
904 } | 913 } |
905 } {9223372036854775807} | 914 } {9223372036854775807} |
906 } | 915 } |
907 | 916 |
908 # If the value is too large, use String->Float conversion. | 917 # If the value is too large, use String->Float conversion. |
909 # | 918 # |
910 ifcapable floatingpoint { | 919 ifcapable floatingpoint { |
911 do_test expr-13.4 { | 920 do_realnum_test expr-13.4 { |
912 execsql { | 921 execsql { |
913 SELECT 0+'9223372036854775808' | 922 SELECT 0+'9223372036854775808' |
914 } | 923 } |
915 } {9.22337203685478e+18} | 924 } {9.22337203685478e+18} |
916 do_test expr-13.5 { | 925 do_realnum_test expr-13.5 { |
917 execsql { | 926 execsql { |
918 SELECT '9223372036854775808'+0 | 927 SELECT '9223372036854775808'+0 |
919 } | 928 } |
920 } {9.22337203685478e+18} | 929 } {9.22337203685478e+18} |
921 } | 930 } |
922 | 931 |
923 # Use String->float conversion if the value is explicitly a floating | 932 # Use String->float conversion if the value is explicitly a floating |
924 # point value. | 933 # point value. |
925 # | 934 # |
926 do_test expr-13.6 { | 935 do_realnum_test expr-13.6 { |
927 execsql { | 936 execsql { |
928 SELECT 0+'9223372036854775807.0' | 937 SELECT 0+'9223372036854775807.0' |
929 } | 938 } |
930 } {9.22337203685478e+18} | 939 } {9.22337203685478e+18} |
931 do_test expr-13.7 { | 940 do_realnum_test expr-13.7 { |
932 execsql { | 941 execsql { |
933 SELECT '9223372036854775807.0'+0 | 942 SELECT '9223372036854775807.0'+0 |
934 } | 943 } |
935 } {9.22337203685478e+18} | 944 } {9.22337203685478e+18} |
936 | 945 |
937 | 946 |
938 finish_test | 947 finish_test |
OLD | NEW |