You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend Base.rationalize instead of defining new function (#56793)
#55886 accidentally created a new function
`Base.MathConstants.rationalize` instead of extending
`Base.rationalize`, which is the reason why `Base.rationalize(Int, π)`
isn’t constant-folded in Julia 1.10 and 1.11:
```
julia> @Btime rationalize(Int,π);
1.837 ns (0 allocations: 0 bytes) # v1.9: constant-folded
88.416 μs (412 allocations: 15.00 KiB) # v1.10: not constant-folded
```
This PR fixes that. It should probably be backported to 1.10 and 1.11.
0 commit comments