当使用bigdecimal时,我得到了错误的期望值。我知道这与操作顺序和java读取它的方式有关,但我不知道如何纠正它。预期产量=5.1
length = 2.4
width = 1
effectivedepth = 1.5
Using brackets
// (length * effectivedepth) + (width * effectivedepth) = Surfacearea50perDepth
//(2.4 * 1.5) + (1 * 1.5) = 5.1
surfacearea50perDepth = length.multiply(effectivedepth.add(width.multiply(effectivedepth)));
Output = 7.2
thanks in advance
1条答案
按热度按时间qfe3c7zg1#
求解,将有效深度置于支架外。。有效深度(宽度+长度)=sa