Skip to content

Conversation

@baggepinnen
Copy link
Contributor

I think that Base.clamp should work nowadays. This would make it easier to spot clamp operations in equations (rather than max(min(...)) and replace them during linearization.

@ChrisRackauckas
Copy link
Member

But is Base.clamp registered? If it isn't, it'll just trace to be the same thing, so not easier to see?

@baggepinnen
Copy link
Contributor Author

It is

julia> @variables x
1-element Vector{Num}:
 x

julia> clamp(x, 0, 1)
clamp(x, 0, 1)

@ChrisRackauckas ChrisRackauckas merged commit 9640a8f into main Dec 4, 2025
9 of 12 checks passed
@ChrisRackauckas ChrisRackauckas deleted the baggepinnen-patch-1 branch December 4, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants