Skip to content

Commit

Permalink
Revert unnecessary changes to complex.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkeller34 committed Mar 22, 2016
1 parent f287112 commit ec11f03
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions base/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,21 @@ complex(z::Complex) = z
flipsign(x::Complex, y::Real) = ifelse(signbit(y), -x, x)

function show(io::IO, z::Complex)
if unitless(z) != z
print(io, "(")
end
r, i = reim(unitless(z))
r, i = reim(z)
compact = limit_output(io)
Base.showcompact_lim(io, r)
showcompact_lim(io, r)
if signbit(i) && !isnan(i)
i = -i
print(io, compact ? "-" : " - ")
else
print(io, compact ? "+" : " + ")
end
Base.showcompact_lim(io, i)
showcompact_lim(io, i)
if !(isa(i,Integer) && !isa(i,Bool) || isa(i,AbstractFloat) && isfinite(i))
print(io, "*")
end
print(io, "im")
if unitless(z) != z
print(io, ") ")
print(io, unit(z))
end
end

show(io::IO, z::Complex{Bool}) =
print(io, z == im ? "im" : "Complex($(z.re),$(z.im))")

Expand Down

0 comments on commit ec11f03

Please sign in to comment.