You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Amit Nithian <an...@gmail.com> on 2012/09/20 18:07:55 UTC

Prevent Log and other math functions from returning "Infinity" and erroring out

Is there any reason why the log function shouldn't be modified to
always take 1+the number being requested to be log'ed? Reason I ask is
I am taking the log of the value output by another function which
could return 0. For testing, I modified it to return 1 which works but
would rather have the log function simply add 1.

Of course I could do something like log(sum(...)) but that seems a bit
much OR just create my own modified log function in my code but was
wondering if there would be any objections to filing an issue and
patch to fix math functions like this from returning "infinity"?

Thanks
Amit