Generates a subarray of a given BigInteger array. - Java java.math

Java examples for java.math:BigInteger

Description

Generates a subarray of a given BigInteger array.

Demo Code


//package com.java2s;
import java.math.BigInteger;

public class Main {
    /**/*from  w w  w.j  a v  a 2  s.c  om*/
     * Generates a subarray of a given BigInteger array.
     * 
     * @param input
     *            - the input BigInteger array
     * @param start
     *            - the start index
     * @param end
     *            - the end index
     * @return a subarray of <tt>input</tt>, ranging from <tt>start</tt> to
     *         <tt>end</tt>
     */
    public static BigInteger[] subArray(BigInteger[] input, int start,
            int end) {
        BigInteger[] result = new BigInteger[end - start];
        System.arraycopy(input, start, result, 0, end - start);
        return result;
    }
}

Related Tutorials