I’m trying force BigDecimal to use symbols (Ex. Instead of Decimal.multiply, do Decimal *), because of the mass parenthesis being involved in this problem.
Can you guys tell me if there’s a way to use symbols on BigDecimal without converting it to Double or something? Or can you convert t into a format like term?
double t = ((1.00 / f1) * ((((4.00 / (ak1 + 1.00)) - (2.00 / (ak1 + 4.00))) - (1.00 / (ak1 + 5.00))) - (1 / (ak1 + 6.00))));
To a format like
term = ((one.divide(f,mc)).multiply(((((four.divide((ak.add(one)),mc)).subtract((two.divide((ak.add(four)),mc)))).subtract((one.divide((ak.add(five)),mc)))).subtract((one.divide((ak.add(six)),mc))))));
I’ve tried recording it lots of times, and spent almost 6 hours trying to figure out where I’m getting wrong with the BigDecimal.
Nope. Since there is no operator overloading in Java.
To make things simpler for yourself write the equation out in parts and identity the bits that are complicated or repeated several times. Break up your computation into these parts and even write helper methods to help you get the sum computed. If you write the whole computation in parts then each part is easier to test.
eg.