Change 'P' function so to use Lea's display options

Issue #88 resolved
Pierre Denis repo owner created an issue

The P function uses the internal probability representation of the distribution:

e = event("1/2")
e
# -> False : 1/2
#    True  : 1/2
P(e)
# -> 1/2

but it does not not take into account the Lea's display options.

set_display_options("%", nb_decimals=2)
e
# -> False :  50.00 %
#    True  :  50.00 %
P(e)
# -> 1/2

It would be more consistent that P takes these display options into account. So, we should get

P(e)
# -> 50.00 %

However, the object returned by P shall not become a string. It shall remain a numerical instance (float, ProbFraction,...) that displays itself as required. So, the update shall not break any expression involving probabilities returned by P.

Comments (5)

  1. Log in to comment