Java BigInteger Value Check isElementOfZn(BigInteger element, BigInteger n)

Here you can find the source of isElementOfZn(BigInteger element, BigInteger n)

Description

is Element Of Zn

License

Apache License

Declaration

public static boolean isElementOfZn(BigInteger element, BigInteger n) 

Method Source Code

//package com.java2s;
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License./*from   w  ww  . j a v  a2 s  .com*/
 */

import java.math.BigInteger;

public class Main {
    public static boolean isElementOfZn(BigInteger element, BigInteger n) {
        return (element.compareTo(BigInteger.ZERO) != -1) && (element.compareTo(n) == -1);
    }
}

Related

  1. isBigger(final BigInteger big1, final BigInteger big2)
  2. isCovers(BigInteger covers, BigInteger value)
  3. isDefined(BigInteger no)
  4. isEven(BigInteger x)
  5. isFermatNumber(BigInteger f)
  6. isGoodGaAndGb(BigInteger g_a, BigInteger p)
  7. isIn20PercentRange(BigInteger first, BigInteger second)