需求
实现
public BigDecimal fucInversion(Listlist) { //逆温 BigDecimal val = null; //开始高度层 BigDecimal firstVal = null; //结束高度层 BigDecimal finalVal; for (int i = 0; i < list.size(); i++) { //i + 1 < list.size if (i < list.size() - 1) { BigDecimal sub = list.get(i).subtract(list.get(i + 1)); if (val == null && sub.compareTo(BigDecimal.ZERO)<0) { firstVal = list.get(i); val = sub; }else if (val!=null && sub.compareTo(BigDecimal.ZERO)<0){ finalVal = list.get(i + 1); val = firstVal.subtract(finalVal); }else if (val!=null&& sub.compareTo(BigDecimal.ZERO)>=0){ return val; } } } return val; }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)