Skip to content

Commit 00f7ea4

Browse files
authored
use compact=false by default when printing.
When doing complex calculations with `DoubleFloat`s it is often really nice to have these extra digits to reassure you that you didn't accidentally lose precision from an accidental `Float64` cast. This will make display slower, but I think it's completely worth it (especially since the compact show can show incorrect decimal digits. For example ``` julia> x=Double64(big(1)+5e-16) 1.00000000000000050000000000000003885 julia> x.hi 1.0000000000000004 ```
1 parent cde8772 commit 00f7ea4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/type/show.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ show(io::IO, ::Type{Double64}) = print(io, "Double64")
44
show(io::IO, ::Type{Double32}) = print(io, "Double32")
55

66
function show(io::IO, x::DoubleFloat{T}) where {T<:IEEEFloat}
7-
compact = get(io, :compact, true)
7+
compact = get(io, :compact, false)
88
if compact
99
str = string(x.hi)
1010
else
@@ -16,7 +16,7 @@ end
1616
function show(io::IO, x::Complex{DoubleFloat{T}}) where {T<:IEEEFloat}
1717
re, im = reim(x)
1818
imstr = isfinite(im) ? "im" : "*im"
19-
compact = get(io, :compact, true)
19+
compact = get(io, :compact, false)
2020
if compact
2121
str = string(HI(re), (signbit(x.im.hi) ? " - " : " + "), abs(HI(im)), imstr)
2222
else

0 commit comments

Comments
 (0)