Skip to content
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

Fix Printf for typemin(<:Base.BitSigned) #42341

Merged
merged 8 commits into from
Sep 27, 2021
Prev Previous commit
Next Next commit
Replace typeof(x) <: T by x isa T
Co-authored-by: Jeff Bezanson <jeff.bezanson@gmail.com>
petvana and JeffBezanson authored Sep 23, 2021
commit 0b6b06c58e6c36d744d34844e6cf194d6a63cff6
2 changes: 1 addition & 1 deletion stdlib/Printf/src/Printf.jl
Original file line number Diff line number Diff line change
@@ -293,7 +293,7 @@ fmt(buf, pos, arg::AbstractFloat, spec::Spec{T}) where {T <: Ints} =
arg2 = toint(arg)
n = i = ndigits(arg2, base=bs, pad=1)
neg = arg2 < 0
if typeof(arg2) <: Base.BitSigned
if arg2 isa Base.BitSigned
x = unsigned(neg ? -arg2 : arg2)
else
x = neg ? -arg2 : arg2