diff --git a/base/show.jl b/base/show.jl index c361fb4dd88b9..6d3df3076d710 100644 --- a/base/show.jl +++ b/base/show.jl @@ -1342,7 +1342,8 @@ function show_unquoted(io::IO, ex::Expr, indent::Int, prec::Int, quote_level::In # scalar multiplication (i.e. "100x") elseif (func === :* && - length(func_args)==2 && isa(func_args[1], Real) && isa(func_args[2], Symbol)) + length(func_args) == 2 && isa(func_args[1], Union{Int, Int64, Float32, Float64}) && + isa(func_args[2], Symbol) && !in(string(func_args[2])[1], ('e', 'E', 'f'))) if func_prec <= prec show_enclosed_list(io, '(', func_args, "", ')', indent, func_prec, quote_level) else diff --git a/test/show.jl b/test/show.jl index 5127be81ba28a..4acf2e1d47458 100644 --- a/test/show.jl +++ b/test/show.jl @@ -138,6 +138,10 @@ end # basic expressions @test_repr "x + y" @test_repr "2e" +@test_repr "2*e1" +@test_repr "2*E1" +@test_repr "2*f1" +@test_repr "0x00*a" @test_repr "!x" @test_repr "f(1, 2, 3)" @test_repr "x = ~y"