lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Re: Modifying the stored norm type
Date Tue, 20 Jun 2006 16:01:01 GMT
On Tuesday 20 June 2006 12:02, Marcus Falck wrote:
> Hi again,
> After a lot of debugging and some API doc reading I have come to the
> conclusion that the static encodeNorm method of the Similarity class
> will encode my boost value into a single byte decimal number.
> And I will loose a lot of resolution and will get severe rounding
> errors. 
> (please correct me if I'm wrong)
> Since I need the exact float value as boost representation this isn't
> good enough in my case.

An exact float value is a bit of an oxymoron.
How exact do you need it to be? 

The range of values that can be encoded by the existing encodeNorm()
and decodeNorm() is quite big (about 10e-10 to 10e+10 iirc),
and since there are only 255 possible values in there (excluding 0),
the rounding errors can be severe indeed.
However, with a smaller range, the rounding errors would also be smaller.

Are 256 different values enough for your case?

Paul Elschot

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message