如何在salesforce中使用十进制幂实现Exponential

如何在salesforce中使用十进制幂实现Exponential,salesforce,salesforce-service-cloud,salesforce-communities,Salesforce,Salesforce Service Cloud,Salesforce Communities,((82125.49845)/(0+1))*((1+((2.84*1)/100))/(1+((2.84*1)/100)+0.005))^(14.083) 上面的计算给出了正确的值76 703.2452 但是,当我在salesforce中使用Math.pow做这些事情时,它并没有给出确切的结果并帮助我进行分类,下面是我在salesforce apex课程中使用的选项 1) 系统调试('>>>pow='+Math.pow((82125.49845/(0+1))*((1+((2.84*1)/

((82125.49845)/(0+1))*((1+((2.84*1)/100))/(1+((2.84*1)/100)+0.005))^(14.083)
上面的计算给出了正确的值76 703.2452

但是,当我在salesforce中使用Math.pow做这些事情时,它并没有给出确切的结果并帮助我进行分类,下面是我在salesforce apex课程中使用的选项

1) 系统调试('>>>pow='+Math.pow((82125.49845/(0+1))*((1+((2.84*1)/100))/(1+((2.84*1)/100)+0.005.doubleValue(),14.0832.doubleValue());

2) 系统调试('>>>final='+(82125.49845/(0+1))*((1+((2.84*1)/100))/(1+((2.84*1)/100)+0.005)).pow(14.0832));

问题在于
pow
函数仅适用于
Double
s,对于实数计算而言,Doubles的精度低于
Decimal
类型

不过,
Math
类确实支持使用自然指数和自然对数对
Decimal
s进行幂运算,因此这应该适用于您:

Math.exp ( Math.log ((82125.49845) / (0 + 1)) + 14.083 * Math.log ((1 + ((2.84*1)/100)) / (1 + ((2.84*1)/100) + 0.005)) )