From: Vincent Pit Date: Tue, 5 Aug 2008 14:16:31 +0000 (+0200) Subject: Explain how we treat core functions in regard to probabilities of return X-Git-Tag: v0.02~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Nary.git;a=commitdiff_plain;h=b1fb25c46e9eec1fb0e8dd8b6fd7f238cec4756a Explain how we treat core functions in regard to probabilities of return --- diff --git a/lib/Sub/Nary.pm b/lib/Sub/Nary.pm index a6b97e0..219e8c3 100644 --- a/lib/Sub/Nary.pm +++ b/lib/Sub/Nary.pm @@ -102,6 +102,10 @@ returns C<3> or C<4> arguments with probability C<1/2> ; and never returns C<1> argument but returns C<2> with probability C<1/2 * 1/2 = 1/4>, C<3> with probability C<1/2 * 1/2 + 1/2 * 1/2 = 1/2> and C<4> with probability C<1/4> too. +=item * If a core function may return different numbers of scalars, each kind is considered equally possible. + +For example, C returns C<13> elements on success and C<0> on error. The according probability will then be C<< { 0 => 0.5, 13 => 0.5 } >>. + =item * The C state is absorbing in regard of all the other ones. This is just a pedantic way to say that "list + fixed length = list".