SQLite4
Check-in [cc1dc90b47]
Not logged in

Overview
Comment: Create sqlite4_num_isnan. Tarball | ZIP archive | SQL archive family | ancestors | descendants | both | num_work files | file ages | folders cc1dc90b47966f9d7e62b0408925afdbc9e79839 peterreid 2013-02-09 05:29:44
Context
 2013-02-09 05:31 Prevent reading out of bounds in sqlite4_num_from_text. Parsing 'in' (prefix of 'inf') with byte count 2 triggered the bug. check-in: 408475b607 user: peterreid tags: num_work 05:29 Create sqlite4_num_isnan. check-in: cc1dc90b47 user: peterreid tags: num_work 05:27 Make LARGEST_UINT64 unsigned. This was causing adjustExponent to fail when compiled with msvc. check-in: 9ff6991d9f user: peterreid tags: num_work
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/math.c.

```   211    211     r.sign = A.sign ^ B.sign;
212    212     r.approx = A.approx | B.approx;
213    213     if( r.approx==0 && A.m%B.m!=0 ) r.approx = 1;
214    214     r.m = A.m/B.m;
215    215     r.e = A.e - B.e;
216    216     return r;
217    217   }
218  +
219  +/*
220  +** Test if A is NaN.
221  +*/
222  +int sqlite4_num_isnan(sqlite4_num A){
223  +  return A.e>SQLITE4_MX_EXP && A.m==0;
224  +}
218    225
219    226   /*
220    227   ** Compare numbers A and B.  Return:
221    228   **
222    229   **    1     if A<B
223    230   **    2     if A==B
224    231   **    3     if A>B

```