Java BigDecimal Add addUlp(BigDecimal x)

Here you can find the source of addUlp(BigDecimal x)

Description

add Ulp

License

Open Source License

Declaration

public static BigDecimal addUlp(BigDecimal x) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;
import java.math.BigInteger;

public class Main {
    public static BigDecimal addUlp(BigDecimal x) {
        BigInteger unscaledValue = x.unscaledValue();
        unscaledValue = unscaledValue.add(BigInteger.ONE);
        return new BigDecimal(unscaledValue, x.scale());
    }//w  w w .j  av a 2  s .  c om
}

Related

  1. addPercent(BigDecimal price, double amount)
  2. addQtde(BigDecimal val1, BigDecimal val2)
  3. addSalePrice(Map complexSalePrice, BigDecimal saleprice)
  4. addToBigDecimalInMap(Map theMap, K mapKey, BigDecimal addNumber)
  5. addToBigDecimalInMap(Object key, BigDecimal value, Map theMap)
  6. addVAT(int priceInCents, BigDecimal vat)
  7. addVatAmount(BigDecimal percentage, BigDecimal amount)
  8. sum(BigDecimal num1, BigDecimal num2, int scale)
  9. sum(BigDecimal[] bigDecimalNumbers)