Java String Hash calcBernstein(int n, int i)

Here you can find the source of calcBernstein(int n, int i)

Description

calc Bernstein

License

Open Source License

Declaration

public static double calcBernstein(int n, int i) 

Method Source Code

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

public class Main {
    public static double calcBernstein(int n, int i) {
        return calcFactorial(n) / calcFactorial(i) / calcFactorial(n - i);

    }// w ww .jav a 2s  . c  o  m

    public static double calcFactorial(int n) {
        int s = 1;
        for (int i = n; i > 1; i--)
            s *= i;
        //TODO: add cache for s value
        return s;

    }
}

Related

  1. bernstein(String key)