330
330
results will come back.
333
<h3>3.3 Roundoff Error</h3>
336
By default, coordinates are stored in an R*Tree using 32-bit floating
337
point values. When a coordinate cannot be exactly represented by a
338
32-bit floating point number, the lower-bound coordinates are rounded down
339
and the upper-bound coordinates are rounded up. Thus, bounding boxes might
340
be slightly larger than specified, but will never be any smaller. This
341
is exactly what is desired for doing the more common "overlapping" queries
342
where the application wants to find every entry in the R*Tree that overlaps
343
a query bounding box. Rounding the entry bounding boxes outward might cause a
344
few extra entries to appears in an overlapping query if the edge of the
345
entry bounding box corresponds to an edge of the query bounding box. But
346
the overlapping query will never miss a valid table entry.
348
<p>However, for a "contained-within" style query, rounding the bounding
349
boxes outward might cause some entries to be excluded from the result set
350
if the edge of the entry bounding box corresponds to the edge of the query
351
bounding box. To guard against this, applications should expand their
352
contained-within query boxes slightly (by 0.000012%) by rounding down the
353
lower coordinates and rounding up the top coordinates, in each dimension.
333
355
<h2>4.0 Using R*Trees Effectively</h2>