Make it easier and less error prone to add simple functions.
Related to SOLR-1302, which added new full classes for things that essentially boil down to a single call to a Math.* method.
There was a lot of boilerplate code copied, and also some bugs (like not delegating createWeight to their sources).
Prototype (representative) patch attached.
We should probably convert some other functions like sqrt, since there is no Math.sqrt(float) hence is must convert anyway. Making it ask for a double and expose a double will be back compatible and simply shift where the conversion to a float takes place.
The other purpose is to move and share standard parsing code since many functions really just want to specify the function.
+1. This was my first time writing functions. Overall, pretty easy to do, but in some cases I felt I was copying a lot of code, with the primary difference being the number of DocValues I needed to pass through. Not quite sure how to handle that in a more general way.
Update adding a bunch of other functions from Math (sin,cos, etc) now that it's easier / smaller to do so.
Correcting Fix Version based on CHANGES.txt, see this thread for more details...
Bulk close for 3.1.0 release