Java BigInteger Value Check isBigger(final BigInteger big1, final BigInteger big2)

Here you can find the source of isBigger(final BigInteger big1, final BigInteger big2)

Description

Returns whether the first BigInteger is bigger than the second.

License

Open Source License

Parameter

Parameter Description
big1 The first BigInteger to compare.
big2 The second BigInteger to compare.

Return

true if the first is bigger than the second, otherwise false.

Declaration

public static boolean isBigger(final BigInteger big1, final BigInteger big2) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigInteger;

public class Main {
    /**/*  w ww .j  av  a 2  s.  com*/
     * Returns whether the first {@link BigInteger} is bigger than the second.
     * 
     * @param big1 The first {@link BigInteger} to compare.
     * @param big2 The second {@link BigInteger} to compare.
     * @return <code>true</code> if the first {@link BigInteger} is bigger
     * than the second, otherwise <code>false</code>.
     */
    public static boolean isBigger(final BigInteger big1, final BigInteger big2) {
        final int compared = big1.compareTo(big2);
        if (compared > 0) {
            return true;
        }
        return false;
    }
}

Related

  1. isCovers(BigInteger covers, BigInteger value)
  2. isDefined(BigInteger no)
  3. isElementOfZn(BigInteger element, BigInteger n)
  4. isEven(BigInteger x)