I have to implement some relatively complex formulas in a Java application. The inputs to these formulas are include up to 30 or so variables. Some of these variables in their natural form are integers, some are reals with a precision of around 3 to 4 decimal places. I am using commons-math for the functions, but I am wondering about precision and convenience:
Would it be best to convert all variables integers to Double prior to passing to the formula methods. This way there is a consistency within the formulas and secondly can I safely use Double for 3 to 4 dp precision? Is there a "best practice" for implementing complex math in Java?