This repository was archived by the owner on Mar 1, 2024. It is now read-only.
Description julia> using Formatting
julia> fmt = FormatExpr (" {1:+11.3e}" )
FormatExpr (" " , " " , Formatting. FormatEntry[Formatting. FormatEntry (Formatting. ArgSpec (1 , false , identity), FormatSpec
cls = f
typ = e
fill =
align = >
sign = +
width = 11
prec = 3
ipre = false
zpad = false
tsep = false
)], String[])
julia> format (fmt, 9.99999999e-308 )
" +9.1000e-308"
Similar to #71 ?
This is worse, though:
julia> format (fmt, 1.0e-309 )
ERROR: InexactError: trunc (Int64, Inf )
Stacktrace:
[1 ] trunc at ./ float. jl: 703 [inlined]
[2 ] trunc at ./ float. jl: 359 [inlined]
[3 ] _pfmt_floate (:: Base.GenericIOBuffer{Array{UInt8,1}} , :: Char , :: Int64 , :: Float64 , :: Int64 , :: Int64 , :: Char ) at / Users/ jagot/ . julia/ packages/ Formatting/ LU9hd/ src/ fmtcore. jl: 204
[4 ] _pfmt_e (:: Base.GenericIOBuffer{Array{UInt8,1}} , :: FormatSpec , :: Float64 ) at / Users/ jagot/ . julia/ packages/ Formatting/ LU9hd/ src/ fmtcore. jl: 251
[5 ] printfmt (:: Base.GenericIOBuffer{Array{UInt8,1}} , :: FormatSpec , :: Float64 ) at / Users/ jagot/ . julia/ packages/ Formatting/ LU9hd/ src/ fmtspec. jl: 190
[6 ] printfmt (:: Base.GenericIOBuffer{Array{UInt8,1}} , :: FormatExpr , :: Float64 ) at / Users/ jagot/ . julia/ packages/ Formatting/ LU9hd/ src/ formatexpr. jl: 147
[7 ] sprint (:: Function , :: FormatExpr , :: Vararg{Any,N} where N; context:: Nothing , sizehint:: Int64 ) at ./ strings/ io. jl: 105
[8 ] sprint at ./ strings/ io. jl: 101 [inlined]
[9 ] format (:: FormatExpr , :: Float64 ) at / Users/ jagot/ . julia/ packages/ Formatting/ LU9hd/ src/ formatexpr. jl: 165
[10 ] top- level scope at REPL[10 ]: 1
(time- propagation) pkg> st Formatting
Status ` ~/work/project/Project.toml`
[59287772 ] Formatting v0.4.1 Reactions are currently unavailable
Similar to #71?
This is worse, though: