Here you can find the source of floor(BigDecimal x)
public static BigInteger floor(BigDecimal x)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; public class Main { public static BigInteger floor(BigDecimal x) { return x.setScale(0, RoundingMode.FLOOR).unscaledValue(); }/*ww w . jav a 2 s. c o m*/ }