In Solr 1.3 and before, +-Inf were handled normally, and scores of NaN caused the relative ordering of other documents to be mixed up.
The new lucene collectors used in 1.4 can't all handle -Inf and NaN (they can return Integer.MAX_VAL to be returned as a docid), leading to exceptions as seen in
SOLR-1778. Because of this Solr's function queries normalized their output to exclude -Inf and NaN. Unfortunately, this is not sufficient, because non-infinite scores can combine with a boolean query into an infinite score. And once you have an infinite score, a simple multiplication by zero will yield a NaN.
Properly handing -Inf is an easy fix. The bigger question is how to handle NaN.
1) punt and realize that any NaNs will mess up the ordering of all other documents for that request
2) Move the FunctionQuery normalization that changes -Inf and NaN into -Float.MAX_VALUE to right before collection (probably with a wrapper collector). This would preserve the ordering of all the other documents, at the cost of a little performance, and information loss (the fact that there was a NaN or -Inf).
3) Fix -Inf handling, and normalize NaN to -Inf
4) Completely order NaNs (probably after -Inf)... This keeps the most information, but would require implementing a custom comparator for score sorting (for anything other than a simple score desc).