Details
Description
This patch adds floating point capability to VTL. It's based on code mainly
written by Peter Romianowski with a supporting role from myself. I'm putting
this in Bugzilla as much of this code was shared over the mailing lists in
fragments this summer and is difficult to access. This issue can serve
instead as a repository for the latest pre-CVS committed version.
Included is the following:
– ability to enter literal numbers in the form of integers or floating point
numbers
– all math and comparison functions work with floating point numbers
– arbitrary objects that implement the interface TemplateNumber are treated
as numbers in arithmetic or comparison
– method calls with numbers, as shown in TestNumberMethodCalls.java
Known Issues:
– an object implementing TemplateNumber cannot be used as an numerical
argument in a method call.
With regards to the last point, please see recently-posted discussion on the
velocity-dev list.
The patch is done against CVS head (1.5 dev, after the map patch). I've
included all parser files. It's not necessary, but you may want to re-run
jjtree and javacc to regenerate Parser.java, etc if you have a customized
Parser.jj.