Here you can find the source of calcBernstein(int n, int i)
public static double calcBernstein(int n, int i)
//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; } }