Java BigDecimal Subtract subUlp(BigDecimal x)

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

Description

sub Ulp

License

Open Source License

Declaration

public static BigDecimal subUlp(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 subUlp(BigDecimal x) {
        BigInteger unscaledValue = x.unscaledValue();
        unscaledValue = unscaledValue.subtract(BigInteger.ONE);
        return new BigDecimal(unscaledValue, x.scale());
    }//  ww  w .j a va  2s.  co  m
}

Related

  1. subtract(Vector a, Vector b)
  2. subtract2Abs(BigDecimal aValue1, BigDecimal aValue2)
  3. subtractPercent(BigDecimal price, double amount)
  4. subtractQtde(BigDecimal val1, BigDecimal val2)
  5. subtractVatAmount(BigDecimal percentage, BigDecimal amount)