|
|
|
@@ -30,7 +30,7 @@ public class PressUtils { |
|
|
|
BigDecimal lt = BigDecimal.valueOf(left_total* 1.0D / 100); |
|
|
|
StatelessReduceRule rule = new DefaultStatelessReduceRule(); |
|
|
|
BigDecimal current = rule.getReduce(tt, lt, limit_num,limit_num - limit_index, scale); |
|
|
|
return current.intValue() * 100; |
|
|
|
return current.multiply(BigDecimal.valueOf(100)).intValue(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -46,13 +46,11 @@ public class PressUtils { |
|
|
|
BigDecimal lt = BigDecimal.valueOf(left_total* 1.0D / 100); |
|
|
|
StatelessReduceRule rule = new StatelessPingReduceRule(); |
|
|
|
BigDecimal current = rule.getReduce(tt, lt, limit_num, limit_num - limit_index, scale); |
|
|
|
return current.intValue() * 100; |
|
|
|
return current.multiply(BigDecimal.valueOf(100)).intValue(); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
int IValue = randomPressValue(2000, 300, 5, 4); |
|
|
|
System.out.println(IValue); |
|
|
|
int iValue = stateLessPressValue( 2000, 400, 5, 4); |
|
|
|
int iValue = stateLessPressValue( 2000, 2000, 5, 0); |
|
|
|
System.out.println(iValue); |
|
|
|
} |
|
|
|
|
|
|
|
|