Here you can find the source of isDoubleOverFlow(final BigDecimal decimal)
public static boolean isDoubleOverFlow(final BigDecimal decimal)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static final BigDecimal MIN_DOUBLE_POSITIVE = new BigDecimal( String.valueOf(Double.MIN_VALUE)); public static final BigDecimal MAX_DOUBLE_POSITIVE = new BigDecimal( String.valueOf(Double.MAX_VALUE)); public static boolean isDoubleOverFlow(final BigDecimal decimal) { if (decimal.signum() == 0) { return false; }/*from ww w .j a v a 2 s.c o m*/ BigDecimal newDecimal = decimal; boolean isPositive = decimal.signum() == 1; if (!isPositive) { newDecimal = decimal.negate(); } return (newDecimal.compareTo(MIN_DOUBLE_POSITIVE) < 0 || newDecimal .compareTo(MAX_DOUBLE_POSITIVE) > 0); } }