-
-
Notifications
You must be signed in to change notification settings - Fork 210
Fixed int.clamp and float.clamp in some case could be seen as misleading. #868
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
base: main
Are you sure you want to change the base?
Conversation
…could be seen as misleading.
lpil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Would you mind rebasing on main and updating the changelog please 🙏
Sorry it took me so long to review this.
|
Okay, I added the changelog, my English is not the greatest but I hope it's good enough >< |
| /// ``` | ||
| /// | ||
| /// ```gleam | ||
| /// clamp(1.2, min: 1.4, max: 0.6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe an inverse should be presented where min and max are turned around?

In the issue #867, I have some suggested arguments naming:
The reason I choose
fn clamp(x, from start_bound, to stop_bound)is that it's more consistent with thelist.range(from start, to stop)arguments naming.