Example usage for com.google.common.math BigIntegerMath log10

List of usage examples for com.google.common.math BigIntegerMath log10

Introduction

In this page you can find the example usage for com.google.common.math BigIntegerMath log10.

Prototype

@GwtIncompatible("TODO")
@SuppressWarnings("fallthrough")
public static int log10(BigInteger x, RoundingMode mode) 

Source Link

Document

Returns the base-10 logarithm of x , rounded according to the specified rounding mode.

Usage

From source file:org.optaplanner.examples.common.persistence.AbstractSolutionImporter.java

public static String getFlooredPossibleSolutionSize(BigInteger possibleSolutionSize) {
    if (possibleSolutionSize.compareTo(BigInteger.valueOf(1000L)) < 0) {
        return possibleSolutionSize.toString();
    }/*w ww  . ja  v a  2s . co m*/
    return "10^" + (BigIntegerMath.log10(possibleSolutionSize, RoundingMode.FLOOR));
}