lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <ysee...@gmail.com>
Subject Re: Functions, floats and doubles
Date Fri, 13 Nov 2009 18:32:40 GMT
On Fri, Nov 13, 2009 at 1:01 PM, Walter Underwood <wunder@wunderwood.org> wrote:
> Float is almost never good enough. The loss of precision is horrific.

Are you saying it's not good enough for this case (the final answer of
a relative distance calculation)?
7 digits of precision is enough to represent a distance across the US
down to the meter... and points closer together would have higher
precision of course.

For storage of the points themselves, 32 bit floats may also often be
enough (~2.4 meter resolution at the equator).  Allowing doubles as an
option would be nice too - but I expect that doubling the fieldcache
may not be worth it for many.
Actually, a 32 bit fixed point representation would have a lot more
accuracy for this (256 times the resolution at the cost of on-the-fly
conversion to a double for calculations).

-Yonik
http://www.lucidimagination.com

Mime
View raw message