Open
Description
On linux, we have
julia> parse(Float32, "10e100")
ERROR: ArgumentError: cannot parse "10e100" as Float32
However, on windows with Julia 1.8, we have
julia> parse(Float32, "10e100")
Inf32
Similarly for underflow, as in parse(Float32, "1e-100")
(though arguably it's less clear that we should throw in this case? We generally accept loss of precision as an unavoidable part of float parsing in general.)
I think this can be traced to a failure in whichever C runtime we're using on windows, as a ccall
to jl_strtof_c
results in:
julia> Libc.errno(0)
@ccall jl_strtof_c("10e100"::Cstring, Ref{Ptr{UInt8}}(C_NULL)::Ptr{Ptr{UInt8}})::Cfloat
Inf32
julia> Libc.errno()
0
(on linux, we have Libc.errno() == Libc.ERANGE
after the same code is run.)