@@ -101,10 +101,10 @@ function writeexp(x::T,
101
101
return String (resize! (buf, pos - 1 ))
102
102
end
103
103
104
- function Base. show (io:: IO , x:: T ) where {T <: Base.IEEEFloat }
104
+ function Base. show (io:: IO , x:: T , forceuntyped :: Bool = false ) where {T <: Base.IEEEFloat }
105
105
compact = get (io, :compact , false )
106
106
buf = Base. StringVector (neededdigits (T))
107
- typed = ! compact && get (io, :typeinfo , Any) != typeof (x)
107
+ typed = ! forceuntyped && ! compact && get (io, :typeinfo , Any) != typeof (x)
108
108
pos = writeshortest (buf, 1 , x, false , false , true , - 1 ,
109
109
x isa Float32 ? UInt8 (' f' ) : UInt8 (' e' ), false , UInt8 (' .' ), typed, compact)
110
110
write (io, resize! (buf, pos - 1 ))
@@ -118,6 +118,6 @@ function Base.string(x::T) where {T <: Base.IEEEFloat}
118
118
return String (resize! (buf, pos - 1 ))
119
119
end
120
120
121
- Base. print (io:: IO , x:: Union{Float16, Float32} ) = show (IOContext ( io, :compact => true ), x )
121
+ Base. print (io:: IO , x:: Union{Float16, Float32} ) = show (io, x, true )
122
122
123
123
end # module
0 commit comments