forked from gambitproject/gambit
-
Notifications
You must be signed in to change notification settings - Fork 3
Behaviour of Gambit number objects in Python #3
Copy link
Copy link
Open
Description
Gambit implements a Number object, which tracks the original representation of a number used to express a payoff or probability. In particular, Numbers should either be decimals or rationals.
This should be transparent to the user.
Initial suggestions for discussion:
- Be sure to harmonize fully with the Python "numeric tower"
- The Gambit Number object should be kept entirely internal. All objects returned when, e.g., retrieving payoffs should be decimal.Decimal or fractions.Fraction, as appropriate. Which to return should be controlled by whether there is a decimal point in the stored text representation.
- Should accept integers when setting payoffs.
- Probably we should not accept floating point numbers, as the semantics of these are tricky. The Python decimal.Decimal and fractions.Fraction objects do not accept floats, because of problems with numbers like 0.1. This looks like a good decision and Gambit should follow suit.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels