Skip to content

Conversation

@klamike
Copy link
Contributor

@klamike klamike commented Dec 31, 2025

First, happy new year! 🍾 Wishing you all the best in 2026 😄


This PR adds a special case for ^ where the LHS is (\euler) and the RHS is an AbstractJuMPScalar. It avoids a conversion from Irrational{:ℯ} to Float64. jump-dev/MathOptInterface.jl#2776 is sort of related.

Before this PR:

julia> m = GenericModel{Float32}();

julia> @variable m x;

julia> expr =^x
2.718281828459045 ^ x

julia> expr.head, expr.args[1], typeof(expr.args[1])
(:^, 2.718281828459045, Float64)

julia> typeof(ℯ)
Irrational{:ℯ}

After this PR:

julia> m = GenericModel{Float32}();

julia> @variable m x;

julia> expr =^x
exp(x)

julia> expr.head, expr.args[1]
(:exp, x)

Signed-off-by: Klamkin, Michael <mklamkin3@gatech.edu>
@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.83%. Comparing base (7ebe98c) to head (e28cdfb).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4101   +/-   ##
=======================================
  Coverage   99.83%   99.83%           
=======================================
  Files          43       43           
  Lines        5910     5915    +5     
=======================================
+ Hits         5900     5905    +5     
  Misses         10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any other methods like this that might cause similar troubles?

@klamike
Copy link
Contributor Author

klamike commented Jan 4, 2026

Are there any other methods like this that might cause similar troubles?

Not that I've run into

@odow odow merged commit acccbbe into jump-dev:master Jan 4, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants