Open
Description
In Julia, repr(x)
is supposed to return valid Julia code that can be executed to reconstruct an object equivalent to x
. For example, repr(::Float16)
and repr(::Float32)
add annotations to x
indicating its type:
julia> repr(Float16(1))
"Float16(1.0)"
julia> repr(Float32(1))
"1.0f0"
However, repr(::Float128)
fails to do this, and evaluating its result yields a Float64
.
julia> repr(Float128(1))
"1.00000000000000000000000000000000000e+00"
julia> 1.00000000000000000000000000000000000e+00 |> typeof
Float64
In particular, repr(::Float128)
is completely broken for Inf128
and NaN128
, which are currently formatted as inf
and nan
.
julia> repr(Float128(Inf))
"inf"
julia> repr(Float128(NaN))
"nan"
julia> inf
ERROR: UndefVarError: `inf` not defined
julia> nan
ERROR: UndefVarError: `nan` not defined
These should format as Inf128
and NaN128
(see #83) respectively.
Metadata
Metadata
Assignees
Labels
No labels