Here you can find the source of addUlp(BigDecimal x)
public static BigDecimal addUlp(BigDecimal x)
//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 }