Java BigDecimal Divide divideByTwo(BigDecimal number)

Here you can find the source of divideByTwo(BigDecimal number)

Description

divide By Two

License

Open Source License

Declaration

public static final BigDecimal divideByTwo(BigDecimal number) 

Method Source Code

//package com.java2s;
/*//from  w  ww .j a  v a  2s  .  co m
 * Copyright (c) 2010 Victor Volle.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/eclipse-1.0.php
 *
 * Contributors:
 *      Victor Volle
 */

import java.math.BigDecimal;
import java.math.MathContext;

public class Main {
    public static final BigDecimal TWO = new BigDecimal("2");

    public static final BigDecimal divideByTwo(BigDecimal number) {
        return number.divide(TWO, MathContext.DECIMAL32);
    }
}

Related

  1. divide(final BigDecimal amount, final BigDecimal divideBy, final int scale)
  2. divide(long res, BigDecimal value)
  3. divide(Vector v, BigDecimal magnitude)
  4. divideBigDecimalsInMap(Map baseMap, BigDecimal divisor)
  5. divideBy(BigDecimal dividend, BigDecimal divisor)
  6. divideMoeda(BigDecimal val1, BigDecimal val2)
  7. divideNonZeroValues(BigDecimal operand, BigDecimal divisor)