static public BigDecimal applyRate(BigDecimal amount, BigDecimal rate, TimeUnit time, long units) { BigDecimal appliedRate = getSeconds(time, units).divide(rate, MathContext.DECIMAL64); BigDecimal factor = BigDecimal.valueOf(Math.exp(appliedRate.doubleValue())); return amount.multiply(factor, MathContext.DECIMAL64); }
static public BigDecimal calculateRate(BigDecimal rate, TimeUnit time, long units) { BigDecimal seconds = getSeconds(time, units); BigDecimal log = ln(rate); return seconds.divide(log, MathContext.DECIMAL64); }
public Currency(byte[] bytes) { super(bytes); type = Type.fromByte(this.hash[0]); if (type == Type.DEMURRAGE) { demurrage = new Demurrage(bytes); } }