Revision d24316ac6465302aa32d9616ab731499c3734bce authored by Nathan Zimmerberg on 07 February 2024, 15:53:14 UTC, committed by GitHub on 07 February 2024, 15:53:14 UTC
Fixes #51731 and #51730 Also fixes one of the previously broken tests: ```julia @test_broken Rational{Int64}(UInt(1), typemin(Int32)) == Int64(1) // Int64(typemin(Int32)) ``` This PR ensures the `Rational{T}` constructor with concrete `T` will only throw if the final numerator and denominator cannot be represented by `T`, or are both zero. If the `T` in `Rational{T}` is not concrete, this PR tries to ensure the numerator and denominator are promoted to the same type. This means `-1*Rational{Integer}(-1, 0x01) == 1` doesn't throw now. A side effect of this is that `Rational{Integer}(Int8(-1), 0x01)` now throws. Also, related to <https://github.com/JuliaLang/julia/pull/25702#issuecomment-359821951>, now `divgcd` doesn't change the types of its inputs and can handle `typemin`, but it still throws a `DivideError` if both inputs are zero.
1 parent 736eeda
StyledStrings.version
STYLEDSTRINGS_BRANCH = main
STYLEDSTRINGS_SHA1 = a1b2ae2434cd7d8199fa8647339422fe0e1d0324
STYLEDSTRINGS_GIT_URL := https://github.com/JuliaLang/StyledStrings.jl.git
STYLEDSTRINGS_TAR_URL = https://api.github.com/repos/JuliaLang/StyledStrings.jl/tarball/$1
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...