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
Add std.clamp #642
Labels
Comments
Would you verify that |
Hmm... that's not obvious and it's actually an argument against Anyway, the function |
sbarzowski
added a commit
to sbarzowski/jsonnet
that referenced
this issue
Dec 20, 2019
sbarzowski
added a commit
to sbarzowski/jsonnet
that referenced
this issue
Dec 20, 2019
sbarzowski
added a commit
to sbarzowski/jsonnet
that referenced
this issue
Dec 20, 2019
Merged
sbarzowski
added a commit
that referenced
this issue
Feb 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like a quite natural and easy addition. Not a very huge value added, but it's a common little thing (and imo way more readable than
std.min(lowerBound, std.max(x, upperBound))
).And when we are at it we can add
std.inRange
which checks if a value is within a given range.The text was updated successfully, but these errors were encountered: