ProGuard can cause incorrect calculations
I have met a pretty strange bug. The following small piece of code uses a rather simple math. protected double C_n_k(int n, int k) { if(k<0 || k>n) return 0; double s=1; for(int i=1;i<=k;i++) s=s*(n+1-i)/i; return s; } Edit Using ProGuard can make it go wrong on some devices. I have it confirmed on HTC One S Android 4.1.1 build 3.16.401.8, but judging by e-mails I got, a lot of phones with Android 4+ are affected. For some of them (Galaxy S3), american operator-branded phones are affected, while international versions are not. Many phones are not affected. Below is the code of activity which