Unbias a random generator: Difference between revisions

m
→‎{{header|C}}: pretty silly to show both n and n% when denom is power of 10
m (→‎{{header|C}}: pretty silly to show both n and n% when denom is power of 10)
Line 34:
cu += unbiased(b);
}
printf("bias %d: %5d %5.3f%% vs %5d %5.3f%%\n", b,
cb, 100. * cb / n, cu, 100. * cu / n);
}
 
return 0;
}</lang>output<lang>bias 3: 3309 33.090% vs 4971 49.710%
bias 4: 2513 25.130% vs 4943 49.430%
bias 5: 1976 19.760% vs 4965 49.650%
bias 6: 1674 16.740% vs 5003 50.030%</lang>
 
=={{header|Clojure}}==
Anonymous user