Skip to content

Commit

Permalink
expand highest_threshold, lowest_threshold docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
HighDiceRoller committed Oct 12, 2024
1 parent 567b7a9 commit e6154b1
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/icepool/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,15 @@ def _iter_outcomes(
yield arg

def highest_threshold(*dice: 'icepool.Die[T]') -> 'icepool.Die[T]':
"""Description TBD
"""Selects the highest chance of rolling >= each outcome among the arguments.
For each outcome, the chance of the result rolling >= to that outcome is the
same as the highest chance among the arguments.
Specifically, for each outcome, the chance of the result rolling >= to that
outcome is the same as the highest chance of rolling >= that outcome among
the arguments.
The result has the same mathematical structure as a probability
distribution, hence the result is a `Die`, even if it is difficult to
interpret as a physical process.
Args:
dice: Any number of dice.
Expand All @@ -250,10 +255,15 @@ def highest_threshold(*dice: 'icepool.Die[T]') -> 'icepool.Die[T]':
return from_cumulative(outcomes, cumulative, reverse=True)

def lowest_threshold(*dice: 'icepool.Die[T]') -> 'icepool.Die[T]':
"""Description TBD
"""Selects the highest chance of rolling <= each outcome among the arguments.
For each outcome, the chance of the result rolling <= to that outcome is the
same as the highest chance among the arguments.
Specifically, for each outcome, the chance of the result rolling <= to that
outcome is the same as the highest chance of rolling <= that outcome among
the arguments.
The result has the same mathematical structure as a probability
distribution, hence the result is a `Die`, even if it is difficult to
interpret as a physical process.
Args:
dice: Any number of dice.
Expand Down

0 comments on commit e6154b1

Please sign in to comment.