- changed status to open
Change 'P' function so to use Lea's display options
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)
-
reporter -
reporter Fix issues with probability representation and sympy integration, remove ProbFraction and ProbDecimal (refs
#88)→ <<cset a41a8be684fd>>
-
reporter Make _display_nb_decimals a class attribute, shared by all ExtDecimal instances (refs
#88)→ <<cset de8af860d6d7>>
-
reporter Fix ExtDecimal.coerce method (refs
#88)→ <<cset 8c4a06877ab1>>
-
reporter - changed status to resolved
- Log in to comment