Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Chance conform to Comparable #102

Open
Samasaur1 opened this issue Jun 9, 2022 · 2 comments
Open

Make Chance conform to Comparable #102

Samasaur1 opened this issue Jun 9, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Samasaur1
Copy link
Owner

The Chance type should be Comparable. It definitely should be comparable to itself, probably to Doubles, and possibly even to Ints (allowing one to say myChance > 0).

@Samasaur1 Samasaur1 added the enhancement New feature or request label Jun 9, 2022
@Samasaur1
Copy link
Owner Author

30c71fc starts to address this

@Samasaur1
Copy link
Owner Author

It makes Chance comparable to itself, and also to integers. It doesn't make it comparable to Double (or Float, I guess) because I wasn't sure whether to compare Chance.value with the double, or Chance(approximating:) with the chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant