Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fold in Peter Reid's fixes and enhancements to the sqlite4_num object. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
8ede88c1df96790b39ab47b79bc83b7c |
User & Date: | drh 2013-02-14 15:32:53.861 |
Context
2013-02-15
| ||
19:20 | Fix a crash bug found by TH4. check-in: 6453240a0f user: drh tags: trunk | |
2013-02-14
| ||
15:32 | Fold in Peter Reid's fixes and enhancements to the sqlite4_num object. check-in: 8ede88c1df user: drh tags: trunk | |
01:51 | Fix sqlite4_num_to_text when formatting an integer with a negative exponent. It was leaving an uninitialized byte in the destination string. Leaf check-in: 3cac6cdb86 user: peterreid tags: num_work | |
2013-02-13
| ||
12:28 | Change the API for binding strings and blobs so that the destructor now carries an extra argument which can be used as the sqlite4_env pointer, thus allowing functions like sqlite4_free() to be used as a string or blob destructor. check-in: 56335097b1 user: drh tags: trunk | |
Changes
Changes to src/math.c.
︙ | |||
211 212 213 214 215 216 217 218 219 220 221 222 223 224 | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | + + + + + + + + + + + + + + | r.sign = A.sign ^ B.sign; r.approx = A.approx | B.approx; if( r.approx==0 && A.m%B.m!=0 ) r.approx = 1; r.m = A.m/B.m; r.e = A.e - B.e; return r; } /* ** Test if A is infinite. */ int sqlite4_num_isinf(sqlite4_num A){ return A.e>SQLITE4_MX_EXP && A.m!=0; } /* ** Test if A is NaN. */ int sqlite4_num_isnan(sqlite4_num A){ return A.e>SQLITE4_MX_EXP && A.m==0; } /* ** Compare numbers A and B. Return: ** ** 1 if A<B ** 2 if A==B ** 3 if A>B |
︙ | |||
237 238 239 240 241 242 243 244 245 246 247 248 249 250 | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | + | return A.sign ? 1 : 3; } if( B.e>SQLITE4_MX_EXP ){ if( B.m==0 ) return 0; return B.sign ? 3 : 1; } if( A.sign!=B.sign ){ if ( A.m==0 && B.m==0 ) return 2; return A.sign ? 1 : 3; } adjustExponent(&A, &B); if( A.sign ){ sqlite4_num t = A; A = B; B = t; |
︙ | |||
319 320 321 322 323 324 325 | 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | i = incr; }else if( zIn[0]=='+' ){ i = incr; }else{ i = 0; } if( nIn<=0 ) goto not_a_valid_number; |
︙ | |||
465 466 467 468 469 470 471 | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | - - + + + + | zNum += m; n -= m; removeTrailingZeros(zNum, &n); if( n>0 ){ zOut[0] = '.'; memcpy(zOut+1, zNum, n); nOut += n; |
︙ |
Changes to src/sqlite.h.in.
︙ | |||
4352 4353 4354 4355 4356 4357 4358 | 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 | - + | ** Every number in SQLite is represented in memory by an instance of ** the following object. */ typedef struct sqlite4_num sqlite4_num; struct sqlite4_num { unsigned char sign; /* Sign of the overall value */ unsigned char approx; /* True if the value is approximate */ |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
460 461 462 463 464 465 466 | 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | - + | /* ** Constants for the largest and smallest possible 64-bit signed integers. ** These macros are designed to work correctly on both 32-bit and 64-bit ** compilers. */ #define LARGEST_INT64 (0xffffffff|(((i64)0x7fffffff)<<32)) #define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64) |
︙ |
Added test/num.test.