All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.brettonw.math.Utility Maven / Gradle / Ivy

package com.brettonw.math;

import java.util.List;

public class Utility {
    public static boolean close (double a, double b) {
        return (Math.abs (a - b) < 1.0e-6);
    }

    public static int[] IntegerListToIntArray (List list) {
        // convert the result list to an array, no library already does this...
        int resultSize = list.size ();
        int[] result = new int[resultSize];
        for (int i = 0; i < resultSize; ++i) {
            result[i] = list.get (i);
        }
        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy