Here you can find the source of equals(BigInteger[] a, BigInteger[] b)
Parameter | Description |
---|---|
a | first BigInteger array |
b | second BigInteger array |
public static boolean equals(BigInteger[] a, BigInteger[] b)
//package com.java2s; import java.math.BigInteger; public class Main { /**/* w w w . j a v a 2 s . com*/ * Checks if two BigInteger arrays contain the same entries * * @param a first BigInteger array * @param b second BigInteger array * @return true or false */ public static boolean equals(BigInteger[] a, BigInteger[] b) { int flag = 0; if (a.length != b.length) { return false; } for (int i = 0; i < a.length; i++) { // avoid branches here! // problem: compareTo on BigIntegers is not // guaranteed constant-time! flag |= a[i].compareTo(b[i]); } return flag == 0; } }